diff options
author | 2014-10-22 17:21:53 +0300 | |
---|---|---|
committer | 2014-10-22 17:21:53 +0300 | |
commit | 0809871aebbdf51b0539ce70e7ff72a53cb1b2e6 (patch) | |
tree | 143e080449eddeb6bb00cdf4665e09121907165c | |
parent | 9bc4b92474ded6ff9097525646311e424a5cddc3 (diff) | |
download | nnn-0809871aebbdf51b0539ce70e7ff72a53cb1b2e6.tar.gz |
Free tmp string if dirname fails
-rw-r--r-- | noice.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |