From: Christian Grothoff Date: Thu, 12 May 2011 09:24:03 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~18498 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5d7cfb058ce600b97b1e65269d3da89793e8bb4d;p=oweals%2Fgnunet.git fix --- diff --git a/src/monkey/action_api.c b/src/monkey/action_api.c index 99809f82f..db73f070a 100644 --- a/src/monkey/action_api.c +++ b/src/monkey/action_api.c @@ -241,12 +241,13 @@ int GNUNET_MONKEY_ACTION_inspect_expression_database(struct GNUNET_MONKEY_ACTION int GNUNET_MONKEY_ACTION_rerun_with_valgrind(struct GNUNET_MONKEY_ACTION_Context* cntxt) { FILE* valgrindPipe; int size; - const char* valgrindCommand; + char* valgrindCommand; cntxt->debug_mode = DEBUG_MODE_VALGRIND; - asprintf(&valgrindCommand, "valgrind --leak-check=yes %s", cntxt->binary_name); + GNUNET_asprintf(&valgrindCommand, "valgrind --leak-check=yes %s", cntxt->binary_name); valgrindPipe = popen(valgrindCommand, "r"); if (NULL == valgrindPipe) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Error in running Valgrind!\n"); + GNUNET_free (valgrindCommand); return GNUNET_NO; } @@ -255,6 +256,7 @@ int GNUNET_MONKEY_ACTION_rerun_with_valgrind(struct GNUNET_MONKEY_ACTION_Context /* Read Valgrind stream */ cntxt->valgrind_output = GNUNET_malloc(size); fscanf(valgrindPipe, "%s", cntxt->valgrind_output); + GNUNET_free (valgrindCommand); if (0 != pclose(valgrindPipe)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Error while closing Valgrind pipe!\n"); return GNUNET_NO;