aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--noice.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/noice.c b/noice.c
index 820b851..24e687a 100644
--- a/noice.c
+++ b/noice.c
@@ -128,8 +128,10 @@ xdirname(const char *path)
* original string if we lose track of it. */
tmp = xstrdup(path);
p = dirname(tmp);
- if (p == NULL)
+ if (p == NULL) {
+ free(tmp);
printerr(1, "dirname");
+ }
/* Make sure this is a malloc(3)-ed string */
p = xstrdup(p);
free(tmp);