cursor: remove unnecessary if before free

free(NULL) is valid and is a no-op.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2022-04-17 17:30:05 +02:00
parent 92e758834c
commit 450bb7c145

View File

@ -234,8 +234,7 @@ XcursorImagesDestroy(XcursorImages *images)
for (n = 0; n < images->nimage; n++)
XcursorImageDestroy(images->images[n]);
if (images->name)
free(images->name);
free(images->name);
free(images);
}
@ -253,8 +252,7 @@ XcursorImagesSetName(XcursorImages *images, const char *name)
return;
strcpy(new, name);
if (images->name)
free(images->name);
free(images->name);
images->name = new;
}
@ -911,8 +909,6 @@ xcursor_load_theme(const char *theme, int size,
for (i = inherits; i; i = _XcursorNextPath(i))
xcursor_load_theme(i, size, load_callback, user_data);
if (inherits)
free(inherits);
free(inherits);
free(xcursor_path);
}