aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-08-19 10:31:10 +0200
committerKevin Wolf <kwolf@redhat.com>2014-08-20 11:51:28 +0200
commit08193dd52ba911077c9a29f62157bc4f3b9564eb (patch)
tree744f26fb8f432107baeb2c0a52927d01516c7e76
parent02c4f26b1517d9e403ec10d6f6ca3c0276d19e43 (diff)
qemu-io-cmds: g_renew() can't fail, bury dead error handling
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--qemu-io-cmds.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index afd8867591..b224ede5fa 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -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;
}