From: Matthias Wachs Date: Thu, 14 Jun 2012 08:51:48 +0000 (+0000) Subject: fix for segfault X-Git-Tag: initial-import-from-subversion-38251~13076 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e5813ba1a2630818148fad6c050c4fedf4edcd34;p=oweals%2Fgnunet.git fix for segfault --- diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index 5ad9d9860..df152ba6a 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c @@ -50,13 +50,16 @@ end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending phase %d, ok is %d\n", phase, ok); - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (NULL != proc) { - GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); + if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + { + GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); + } + GNUNET_OS_process_wait (proc); + GNUNET_OS_process_destroy (proc); + proc = NULL; } - GNUNET_OS_process_wait (proc); - GNUNET_OS_process_destroy (proc); - proc = NULL; GNUNET_DISK_pipe_close (pipe_stdout); if (ok == 1) {