]> Git Repo - qemu.git/commitdiff
qemu-io-cmds: g_renew() can't fail, bury dead error handling
authorMarkus Armbruster <[email protected]>
Tue, 19 Aug 2014 08:31:10 +0000 (10:31 +0200)
committerKevin Wolf <[email protected]>
Wed, 20 Aug 2014 09:51:28 +0000 (11:51 +0200)
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
qemu-io-cmds.c

index afd886759109afc9c283a9b05b1bfe1aaba7c209..b224ede5fa0ef309005042b8e5459a59cb74a6ea 100644 (file)
@@ -115,22 +115,13 @@ static char **breakline(char *input, int *count)
     int c = 0;
     char *p;
     char **rval = g_new0(char *, 1);
-    char **tmp;
 
     while (rval && (p = qemu_strsep(&input, " ")) != NULL) {
         if (!*p) {
             continue;
         }
         c++;
-        tmp = g_renew(char *, rval, (c + 1));
-        if (!tmp) {
-            g_free(rval);
-            rval = NULL;
-            c = 0;
-            break;
-        } else {
-            rval = tmp;
-        }
+        rval = g_renew(char *, rval, (c + 1));
         rval[c - 1] = p;
         rval[c] = NULL;
     }
This page took 0.030876 seconds and 4 git commands to generate.