Commit 08193dd5 authored by Markus Armbruster's avatar Markus Armbruster Committed by Kevin Wolf

qemu-io-cmds: g_renew() can't fail, bury dead error handling

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 02c4f26b
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment