lib/util: remove some unused_result warnings.
authorGünther Deschner <gd@samba.org>
Thu, 9 Sep 2010 09:10:01 +0000 (11:10 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 9 Sep 2010 09:11:04 +0000 (11:11 +0200)
Guenther

lib/util/util.c

index c0af4b0116244bf0b170585eca760219337d2315..076ddf47fc5e4458fd3959e1586940e14206e243 100644 (file)
@@ -899,8 +899,13 @@ void *allocate_anonymous_shared(size_t bufsz)
 void samba_start_debugger(void)
 {
        char *cmd = NULL;
-       asprintf(&cmd, "xterm -e \"gdb --pid %u\"&", getpid());
-       system(cmd);
+       if (asprintf(&cmd, "xterm -e \"gdb --pid %u\"&", getpid()) == -1) {
+               return;
+       }
+       if (system(cmd) == -1) {
+               free(cmd);
+               return;
+       }
        free(cmd);
        sleep(2);
 }