diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-10 01:10:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:29 -0500 |
commit | 76ecf81428c161a98a5621b55a64cb8515f80585 (patch) | |
tree | 542798f01d1582b00d7d20a93effba33f98ee1fc /source4/intl/lang_tdb.c | |
parent | c6881d1e650fd284a366af76f5a214a5de05cc0c (diff) | |
download | samba-76ecf81428c161a98a5621b55a64cb8515f80585.tar.gz samba-76ecf81428c161a98a5621b55a64cb8515f80585.tar.xz samba-76ecf81428c161a98a5621b55a64cb8515f80585.zip |
r8273: fixed some memory leaks in smbscript. This required converting
file_load() to use talloc, which impacted quite a few bits of code,
including our smb.conf processing.
took the opportunity to remove the gloabls in params.c while doing this
(This used to be commit b220756cb4f1d201ba3e771ca67e4bfae5eae748)
Diffstat (limited to 'source4/intl/lang_tdb.c')
-rw-r--r-- | source4/intl/lang_tdb.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/intl/lang_tdb.c b/source4/intl/lang_tdb.c index de08c82ce4e..be8bce2391d 100644 --- a/source4/intl/lang_tdb.c +++ b/source4/intl/lang_tdb.c @@ -37,14 +37,19 @@ static BOOL load_msg(const char *msg_file) int num_lines, i; char *msgid, *msgstr; TDB_DATA key, data; + TALLOC_CTX *tmp_ctx = talloc_new(NULL); - lines = file_lines_load(msg_file, &num_lines); + lines = file_lines_load(msg_file, &num_lines, tmp_ctx); if (!lines) { + talloc_free(tmp_ctx); return False; } - if (tdb_lockall(tdb) != 0) return False; + if (tdb_lockall(tdb) != 0) { + talloc_free(tmp_ctx); + return False; + } /* wipe the db */ tdb_traverse(tdb, tdb_traverse_delete_fn, NULL); @@ -71,7 +76,7 @@ static BOOL load_msg(const char *msg_file) } } - file_lines_free(lines); + talloc_free(tmp_ctx); tdb_unlockall(tdb); return True; |