- fix cli arg parse
[oweals/gnunet.git] / src / util / signal.c
index 92042018f4abefae972715c603f27253ecadf7b0..84237f65d69c0fa3a42ad926a678707121421b77 100644 (file)
@@ -64,7 +64,7 @@ GNUNET_SIGNAL_handler_install (int signum, GNUNET_SIGNAL_Handler handler)
   struct sigaction sig;
 #endif
 
-  ret = GNUNET_malloc (sizeof (struct GNUNET_SIGNAL_Context));
+  ret = GNUNET_new (struct GNUNET_SIGNAL_Context);
   ret->sig = signum;
   ret->method = handler;
 #ifndef MINGW
@@ -120,8 +120,8 @@ void
 GNUNET_SIGNAL_raise (const int sig)
 {
   struct GNUNET_SIGNAL_Context *ctx;
-  
-  for (ctx = sc_head; NULL != sc_head; ctx = ctx->next)
+
+  for (ctx = sc_head; NULL != ctx; ctx = ctx->next)
   {
     if (sig != ctx->sig)
       continue;