From bc8e868c76a54685f85d0668aaeeb843c27c91c1 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 22 Feb 2010 12:23:03 +0000 Subject: [PATCH] fixing leaks --- src/util/test_os_start_process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index 8453bde05..5a47c2f5c 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c @@ -107,13 +107,11 @@ static void task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { char *fn; - char *buf; int fd_stdout; int fd_stdin; const struct GNUNET_DISK_FileHandle *stdout_read_handle; - buf = GNUNET_malloc(strlen(test_phrase) + 1); GNUNET_asprintf(&fn, "cat"); hello_pipe_stdin = GNUNET_DISK_pipe(GNUNET_YES); @@ -122,11 +120,13 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL)) { ok = 1; + GNUNET_free (fn); return; } pid = GNUNET_OS_start_process (hello_pipe_stdin, hello_pipe_stdout, fn, "test_gnunet_echo_hello", "-", NULL); + GNUNET_free (fn); /* Close the write end of the read pipe */ GNUNET_DISK_pipe_close_end(hello_pipe_stdout, GNUNET_DISK_PIPE_END_WRITE); -- 2.25.1