mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user