diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-05-12 09:24:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-05-12 09:24:03 +0000 |
commit | 5d7cfb058ce600b97b1e65269d3da89793e8bb4d (patch) | |
tree | 98915fcca93f980366f9d56638acc492f9244694 /src/monkey | |
parent | 11f47e3fff7ad51a8f8076e84abb216dfe17ef19 (diff) | |
download | gnunet-5d7cfb058ce600b97b1e65269d3da89793e8bb4d.tar.gz gnunet-5d7cfb058ce600b97b1e65269d3da89793e8bb4d.zip |
fix
Diffstat (limited to 'src/monkey')
-rw-r--r-- | src/monkey/action_api.c | 6 |
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 | |||
241 | int GNUNET_MONKEY_ACTION_rerun_with_valgrind(struct GNUNET_MONKEY_ACTION_Context* cntxt) { | 241 | int GNUNET_MONKEY_ACTION_rerun_with_valgrind(struct GNUNET_MONKEY_ACTION_Context* cntxt) { |
242 | FILE* valgrindPipe; | 242 | FILE* valgrindPipe; |
243 | int size; | 243 | int size; |
244 | const char* valgrindCommand; | 244 | char* valgrindCommand; |
245 | cntxt->debug_mode = DEBUG_MODE_VALGRIND; | 245 | cntxt->debug_mode = DEBUG_MODE_VALGRIND; |
246 | asprintf(&valgrindCommand, "valgrind --leak-check=yes %s", cntxt->binary_name); | 246 | GNUNET_asprintf(&valgrindCommand, "valgrind --leak-check=yes %s", cntxt->binary_name); |
247 | valgrindPipe = popen(valgrindCommand, "r"); | 247 | valgrindPipe = popen(valgrindCommand, "r"); |
248 | if (NULL == valgrindPipe) { | 248 | if (NULL == valgrindPipe) { |
249 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Error in running Valgrind!\n"); | 249 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Error in running Valgrind!\n"); |
250 | GNUNET_free (valgrindCommand); | ||
250 | return GNUNET_NO; | 251 | return GNUNET_NO; |
251 | } | 252 | } |
252 | 253 | ||
@@ -255,6 +256,7 @@ int GNUNET_MONKEY_ACTION_rerun_with_valgrind(struct GNUNET_MONKEY_ACTION_Context | |||
255 | /* Read Valgrind stream */ | 256 | /* Read Valgrind stream */ |
256 | cntxt->valgrind_output = GNUNET_malloc(size); | 257 | cntxt->valgrind_output = GNUNET_malloc(size); |
257 | fscanf(valgrindPipe, "%s", cntxt->valgrind_output); | 258 | fscanf(valgrindPipe, "%s", cntxt->valgrind_output); |
259 | GNUNET_free (valgrindCommand); | ||
258 | if (0 != pclose(valgrindPipe)) { | 260 | if (0 != pclose(valgrindPipe)) { |
259 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Error while closing Valgrind pipe!\n"); | 261 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Error while closing Valgrind pipe!\n"); |
260 | return GNUNET_NO; | 262 | return GNUNET_NO; |