From efb4a61c8d614796fc1ccc52ac54c38a5a50508b Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 6 Sep 2012 16:41:48 +0000 Subject: [PATCH] -coverity --- src/gns/gnunet-gns-proxy.c | 3 ++- src/gns/gnunet-gns.c | 4 ++-- src/gns/test_gns_simple_lookup.c | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 67da4a23b..cdc18e3f6 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c @@ -587,6 +587,7 @@ con_post_data_iter (void *cls, memcpy (new_value, pdata->value, pdata->total_bytes); memcpy (new_value+off, data, size); GNUNET_free (pdata->value); + pdata->value = new_value; pdata->total_bytes += size; return MHD_YES; @@ -2109,11 +2110,11 @@ create_response (void *cls, { if (GNUNET_YES == ctask->is_httppost) { - i = 0; for (upload_data_iter = ctask->upload_data_head; NULL != upload_data_iter; upload_data_iter = upload_data_iter->next) { + i = 0; if (NULL != upload_data_iter->filename) { forms[i].option = CURLFORM_FILENAME; diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index 21cc50c26..a54204283 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c @@ -242,7 +242,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (!raw) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "No private zone key file name specified in configuration!\n"); - shorten_key = NULL; + private_key = NULL; } else { @@ -290,7 +290,7 @@ run (void *cls, char *const *args, const char *cfgfile, return; } - if (NULL != shorten_name) + if ((NULL != shorten_name) && (NULL != shorten_zone) && (NULL != private_zone)) { shorten_request = GNUNET_GNS_shorten_zone (gns, shorten_name, private_zone, diff --git a/src/gns/test_gns_simple_lookup.c b/src/gns/test_gns_simple_lookup.c index d3c96fd0b..1e0326328 100644 --- a/src/gns/test_gns_simple_lookup.c +++ b/src/gns/test_gns_simple_lookup.c @@ -186,6 +186,7 @@ do_check (void *cls, if (NULL == namestore_handle) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n"); + GNUNET_free (web); end_badly_now () ; return; } @@ -195,6 +196,7 @@ do_check (void *cls, &alice_keyfile)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get key from cfg\n"); + GNUNET_free (web); end_badly_now () ; return; } -- 2.25.1