Remove unwanted memory allocation for response

It is expected as pointer to struct response with size of the struct,
not pointer to the pointer, but never returned to caller.
It should be allocated by caller.

Signed-off-by: OBATA Akio <obache@wizdas.com>
(cherry picked from commit 8d21538ce0)
r14.0.x
OBATA Akio 5 years ago committed by Michele Calgaro
parent 7d1525c981
commit 656bafb6e9
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -425,12 +425,9 @@ CARDDAV_RESPONSE carddav_get_object(response *result,
CARDDAV_RESPONSE carddav_response;
g_return_val_if_fail(info != NULL, TRUE);
g_return_val_if_fail(result != NULL, NOTIMPLEMENTED);
init_runtime(info);
if (!result) {
result = malloc(sizeof(response *));
memset(result, '\0', sizeof(response *));
}
init_carddav_settings(&settings);
settings.ACTION = GET;
settings.start = start;
@ -489,12 +486,9 @@ CARDDAV_RESPONSE carddav_getall_object(response* result,
CARDDAV_RESPONSE carddav_response;
g_return_val_if_fail(info != NULL, TRUE);
g_return_val_if_fail(result != NULL, NOTIMPLEMENTED);
init_runtime(info);
if (!result) {
result = malloc(sizeof(response *));
memset(result, '\0', sizeof(response *));
}
init_carddav_settings(&settings);
settings.ACTION = GETALL;
if (info->options->debug)
@ -553,12 +547,9 @@ CARDDAV_RESPONSE carddav_getall_object_by_uri(response* result,
CARDDAV_RESPONSE carddav_response;
g_return_val_if_fail(info != NULL, TRUE);
g_return_val_if_fail(result != NULL, NOTIMPLEMENTED);
init_runtime(info);
if (!result) {
result = malloc(sizeof(response *));
memset(result, '\0', sizeof(response *));
}
init_carddav_settings(&settings);
settings.ACTION = GETALL;
if (info->options->debug)
@ -616,12 +607,9 @@ CARDDAV_RESPONSE carddav_get_displayname(response* result,
CARDDAV_RESPONSE carddav_response;
g_return_val_if_fail(info != NULL, TRUE);
g_return_val_if_fail(result != NULL, NOTIMPLEMENTED);
init_runtime(info);
if (!result) {
result = malloc(sizeof(response *));
memset(result, '\0', sizeof(response *));
}
init_carddav_settings(&settings);
settings.ACTION = GETCALNAME;
if (info->options->debug)

Loading…
Cancel
Save