diff options
| author | Simon Ser <contact@emersion.fr> | 2022-04-17 17:30:05 +0200 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2022-05-23 08:59:05 +0000 |
| commit | 450bb7c1452e901660311f1d971d007b3769b3fc (patch) | |
| tree | 8724d3411f7970cf0c061326340c6eabd95236a5 | |
| parent | cursor: fix variable declaration style (diff) | |
| download | wayland-450bb7c1452e901660311f1d971d007b3769b3fc.tar wayland-450bb7c1452e901660311f1d971d007b3769b3fc.tar.gz wayland-450bb7c1452e901660311f1d971d007b3769b3fc.tar.bz2 wayland-450bb7c1452e901660311f1d971d007b3769b3fc.tar.lz wayland-450bb7c1452e901660311f1d971d007b3769b3fc.tar.xz wayland-450bb7c1452e901660311f1d971d007b3769b3fc.tar.zst wayland-450bb7c1452e901660311f1d971d007b3769b3fc.zip | |
cursor: remove unnecessary if before free
free(NULL) is valid and is a no-op.
Signed-off-by: Simon Ser <contact@emersion.fr>
| -rw-r--r-- | cursor/xcursor.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/cursor/xcursor.c b/cursor/xcursor.c index db796da..fd2b3c8 100644 --- a/cursor/xcursor.c +++ b/cursor/xcursor.c @@ -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); } |
