Remove useless NULL check for qemu_strdup return value
Found with this Coccinelle semantic patch: @@ expression E; identifier ptr; identifier fn ~= "qemu_strn?dup"; @@ -ptr = fn(E); -if (ptr == NULL) { ... } - +ptr = fn(E); Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
8e00128d32
commit
f143efa60c
@ -426,9 +426,6 @@ static int local_rename(FsContext *ctx, const char *oldpath,
|
||||
int err;
|
||||
|
||||
tmp = qemu_strdup(rpath(ctx, oldpath));
|
||||
if (tmp == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
err = rename(tmp, rpath(ctx, newpath));
|
||||
if (err == -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user