summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-05-12 09:24:03 +0000
committerChristian Grothoff <christian@grothoff.org>2011-05-12 09:24:03 +0000
commit5d7cfb058ce600b97b1e65269d3da89793e8bb4d (patch)
tree98915fcca93f980366f9d56638acc492f9244694 /src
parent11f47e3fff7ad51a8f8076e84abb216dfe17ef19 (diff)
fix
Diffstat (limited to 'src')
-rw-r--r--src/monkey/action_api.c6
1 files changed, 4 insertions, 2 deletions
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;