summaryrefslogtreecommitdiff
path: root/resolve_host.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@samba.org>2013-10-10 22:05:05 -0400
committerJeff Layton <jlayton@samba.org>2013-10-11 11:02:11 -0400
commit7e2e95d0c84bd6960c46f1fa1c8227c50dd7a4b3 (patch)
tree5d6418f358989a353c575beecc483afc73cf3755 /resolve_host.c
parent9f1c0722a3e20047bcffe3a43f229e891da8c01b (diff)
downloadcifs-utils-7e2e95d0c84bd6960c46f1fa1c8227c50dd7a4b3.tar.gz
cifs-utils-7e2e95d0c84bd6960c46f1fa1c8227c50dd7a4b3.tar.bz2
cifs-utils-7e2e95d0c84bd6960c46f1fa1c8227c50dd7a4b3.zip
mount.cifs: fix bad free() of string returned by dirname()
Coverity says: Error: CPPCHECK_WARNING: [#def10] cifs-utils-6.2/mount.cifs.c:1518: error[memleakOnRealloc]: Common realloc mistake: 'mtabdir' nulled but not freed upon failure del_mtab has a number of bugs in handling of allocated memory: a) the return value of strdup() is not checked b) It calls realloc() on a pointer that wasn't returned by an allocation function (e.g. malloc, calloc, etc.) c) If realloc() fails, it doesn't call free() on the original memory returned by strdup() Fix all of these bugs and add newlines to the end of the error messages in del_mtab. Signed-off-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'resolve_host.c')
0 files changed, 0 insertions, 0 deletions