Fix all warnings in source3 with gcc4.3.
[kai/samba.git] / source3 / utils / net_time.c
index 8be9ed922cf4f2fd3250f466853c556eb53f760c..b6198376afd2657c1595acbf3e6bfab2ec695440 100644 (file)
@@ -116,7 +116,9 @@ static int net_time_set(struct net_context *c, int argc, const char **argv)
        /* yes, I know this is cheesy. Use "net time system" if you want to
           roll your own. I'm putting this in as it works on a large number
           of systems and the user has a choice in whether its used or not */
-       asprintf(&cmd, "/bin/date %s", systime(t));
+       if (asprintf(&cmd, "/bin/date %s", systime(t)) == -1) {
+               return -1;
+       }
        result = system(cmd);
        if (result)
                d_fprintf(stderr, "%s failed.  Error was (%s)\n",