summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-08 07:13:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:11:06 -0500
commit3a1c4cb93dc262028ffbebd9ebeed69f4816cf09 (patch)
tree2168bbd4401bbb689a54d076218c9c97c7f8e3dd /source
parent29b4b986cc225a98d263c883fd52e8b210099b9e (diff)
downloadsamba-3a1c4cb93dc262028ffbebd9ebeed69f4816cf09.tar.gz
samba-3a1c4cb93dc262028ffbebd9ebeed69f4816cf09.tar.xz
samba-3a1c4cb93dc262028ffbebd9ebeed69f4816cf09.zip
r14026: Fix resource leak on error exit. Coverity CID #65.
Jeremy.
Diffstat (limited to 'source')
-rw-r--r--source/tdb/tdbback.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/tdb/tdbback.c b/source/tdb/tdbback.c
index 3f5bf3891b3..7967a6bbf54 100644
--- a/source/tdb/tdbback.c
+++ b/source/tdb/tdbback.c
@@ -108,6 +108,7 @@ int backup_tdb(const char *old_name, const char *new_name)
/* stat the old tdb to find its permissions */
if (stat(old_name, &st) != 0) {
perror(old_name);
+ free(tmp_name);
return 1;
}
@@ -115,6 +116,7 @@ int backup_tdb(const char *old_name, const char *new_name)
tdb = tdb_open(old_name, 0, 0, O_RDWR, 0);
if (!tdb) {
printf("Failed to open %s\n", old_name);
+ free(tmp_name);
return 1;
}