summaryrefslogtreecommitdiff
path: root/src/samples/generate_payments.c
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2017-04-22 16:50:23 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2017-04-22 16:50:23 +0200
commit70765db54c9fd0690e9a0865b244a3c0e5014ff4 (patch)
treebf190fee7ca4eeec8cc7f119a09df927df362af6 /src/samples/generate_payments.c
parent002bae744c7307fb86d7ff52f62be5b9a1d85a31 (diff)
downloadmerchant-70765db54c9fd0690e9a0865b244a3c0e5014ff4.tar.gz
merchant-70765db54c9fd0690e9a0865b244a3c0e5014ff4.tar.bz2
merchant-70765db54c9fd0690e9a0865b244a3c0e5014ff4.zip
fix segfaults caused by the way the payment generator
killed merchants and exchanges.
Diffstat (limited to 'src/samples/generate_payments.c')
-rw-r--r--src/samples/generate_payments.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/samples/generate_payments.c b/src/samples/generate_payments.c
index e5b31f7c..4ecd35fe 100644
--- a/src/samples/generate_payments.c
+++ b/src/samples/generate_payments.c
@@ -598,6 +598,9 @@ add_incoming_cb (void *cls,
if (MHD_HTTP_OK != http_status)
{
GNUNET_break (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "%s",
+ json_dumps (full_response, JSON_INDENT (2)));
fail (is);
return;
}
@@ -1693,11 +1696,14 @@ main (int argc,
GNUNET_SIGNAL_handler_uninstall (shc_chld);
shc_chld = NULL;
GNUNET_DISK_pipe_close (sigpipe);
- GNUNET_OS_process_kill (merchantd,
- SIGTERM);
- GNUNET_OS_process_wait (merchantd);
- GNUNET_OS_process_destroy (merchantd);
- if (!remote_exchange)
+ if (NULL != merchantd)
+ {
+ GNUNET_OS_process_kill (merchantd,
+ SIGTERM);
+ GNUNET_OS_process_wait (merchantd);
+ GNUNET_OS_process_destroy (merchantd);
+ }
+ if (!remote_exchange && NULL != exchanged)
{
GNUNET_OS_process_kill (exchanged,
SIGTERM);