This website works better with JavaScript.
Home
Explore
Help
Sign In
Immanuel
/
nnn
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
Free tmp string if dirname fails
master
lostd
10 years ago
parent
9bc4b92474
commit
0809871aeb
1 changed files
with
3 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+3
-1
noice.c
+ 3
- 1
noice.c
View File
@@ -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);
Write
Preview
Loading…
Cancel
Save