git.samba.org
/
tprouty
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5cd4b7b
)
Fix Coverity IDs 879 and 880 (RESOURCE_LEAK, REVERSE_INULL)
author
Volker Lendecke
<vl@samba.org>
Thu, 12 Feb 2009 21:58:24 +0000
(22:58 +0100)
committer
Volker Lendecke
<vl@samba.org>
Thu, 12 Feb 2009 22:02:53 +0000
(23:02 +0100)
source3/client/umount.cifs.c
patch
|
blob
|
history
diff --git
a/source3/client/umount.cifs.c
b/source3/client/umount.cifs.c
index 81925eda27544713ec1e515414b0af75db420cbd..1227e7a204325023c3d3ba76243fdb572fcc4134 100644
(file)
--- a/
source3/client/umount.cifs.c
+++ b/
source3/client/umount.cifs.c
@@
-240,10
+240,9
@@
static int remove_from_mtab(char * mountpoint)
static char *
canonicalize(char *path)
{
- char *canonical
= malloc (PATH_MAX + 1)
;
+ char *canonical;
- if (!canonical) {
- fprintf(stderr, "Error! Not enough memory!\n");
+ if (path == NULL) {
return NULL;
}
@@
-252,8
+251,12
@@
canonicalize(char *path)
return NULL;
}
- if (path == NULL)
+ canonical = (char *)malloc (PATH_MAX + 1);
+
+ if (!canonical) {
+ fprintf(stderr, "Error! Not enough memory!\n");
return NULL;
+ }
if (realpath (path, canonical))
return canonical;