summaryrefslogtreecommitdiff
path: root/source3
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
commit6b591819dd64dfd4001b954a000716730a89b2f6 (patch)
treef3081e207972a2c90219309f023a3cd1f23fc769 /source3
parent874a9d02de00d9853d77d401cf559ee69b1e90fd (diff)
downloadsamba-6b591819dd64dfd4001b954a000716730a89b2f6.tar.gz
samba-6b591819dd64dfd4001b954a000716730a89b2f6.tar.bz2
samba-6b591819dd64dfd4001b954a000716730a89b2f6.zip
r14026: Fix resource leak on error exit. Coverity CID #65.
Jeremy. (This used to be commit 3a1c4cb93dc262028ffbebd9ebeed69f4816cf09)
Diffstat (limited to 'source3')
-rw-r--r--source3/tdb/tdbback.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/tdb/tdbback.c b/source3/tdb/tdbback.c
index 3f5bf3891b..7967a6bbf5 100644
--- a/source3/tdb/tdbback.c
+++ b/source3/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;
}