if ((ptr->flags.use_udp && list[x].type != MEMCACHED_CONNECTION_UDP)
|| ((list[x].type == MEMCACHED_CONNECTION_UDP)
&& ! (ptr->flags.use_udp)) )
+ {
return MEMCACHED_INVALID_HOST_PROTOCOL;
+ }
WATCHPOINT_ASSERT(list[x].hostname[0] != 0);
if (memcached_is_allocated(self))
{
- libmemcached_free(self->root, self);
+ if (self->root)
+ {
+ libmemcached_free(self->root, self);
+ }
+ else
+ {
+ free(self);
+ }
}
else
{
return NULL;
}
- /* TODO: Check return type */
+ /* @todo Check return type */
memcached_server_create_with(NULL, &new_host_list[count-1], hostname, port, weight, MEMCACHED_CONNECTION_TCP);
+ // Handset allocated since
+ new_host_list->options.is_allocated= true;
+
/* Backwards compatibility hack */
memcached_servers_set_count(new_host_list, count);
return TEST_SUCCESS;
}
+// Look for memory leak
+static test_return_t regression_bug_728286(memcached_st *unused)
+{
+ (void)unused;
+ memcached_server_st *servers = memcached_servers_parse("1.2.3.4:99");
+ memcached_server_free(servers);
+
+ return TEST_SUCCESS;
+}
+
static void memcached_die(memcached_st* mc, memcached_return error, const char* what, uint32_t it)
{
fprintf(stderr, "Iteration #%u: ", it);
{"lp:490486", 1, (test_callback_fn)regression_bug_490486 },
{"lp:583031", 1, (test_callback_fn)regression_bug_583031 },
{"lp:?", 1, (test_callback_fn)regression_bug_ },
+ {"lp:728286", 1, (test_callback_fn)regression_bug_728286 },
{0, 0, (test_callback_fn)0}
};