s4:torture:nbench: fix O3 error unused result of asprintf
authorMichael Adam <obnox@samba.org>
Tue, 5 Apr 2016 16:52:29 +0000 (18:52 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 12 May 2016 22:16:16 +0000 (00:16 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
source4/torture/nbench/nbench.c

index 3258e1915d5827532db00ce94e46dee7f663b653..2f1043590a74b67ed3cbe5c976ca70f381023c22 100644 (file)
@@ -64,6 +64,7 @@ static bool run_netbench(struct torture_context *tctx, struct smbcli_state *cli,
        bool correct = true;
        double target_rate = torture_setting_double(tctx, "targetrate", 0);     
        int n = 0;
+       int ret;
 
        if (target_rate != 0 && client == 0) {
                printf("Targeting %.4f MByte/sec\n", target_rate);
@@ -77,7 +78,10 @@ static bool run_netbench(struct torture_context *tctx, struct smbcli_state *cli,
                }
        }
 
-       asprintf(&cname, "client%d", client+1);
+       ret = asprintf(&cname, "client%d", client+1);
+       if (ret == -1) {
+               return false;
+       }
 
        f = fopen(loadfile, "r");