diff options
author | Jeremy Allison <jra@samba.org> | 2010-07-27 02:36:57 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-07-27 02:38:14 -0700 |
commit | 6446c75f70fcb80c9d66fd7d6d9cfdd01157c385 (patch) | |
tree | 1cff7405d2ccb671b94fe31712a87b83515c4747 | |
parent | 1890a2a1725848b622f1cd7b904b3c41fd318568 (diff) | |
download | samba-6446c75f70fcb80c9d66fd7d6d9cfdd01157c385.tar.gz samba-6446c75f70fcb80c9d66fd7d6d9cfdd01157c385.tar.bz2 samba-6446c75f70fcb80c9d66fd7d6d9cfdd01157c385.zip |
Fix several places where talloc_asprintf returns were unchecked.
Jeremy.
-rw-r--r-- | source3/lib/tdb_validate.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/lib/tdb_validate.c b/source3/lib/tdb_validate.c index c5cb1b44d4..e001d9cb76 100644 --- a/source3/lib/tdb_validate.c +++ b/source3/lib/tdb_validate.c @@ -281,6 +281,11 @@ static int tdb_backup(TALLOC_CTX *ctx, const char *src_path, } tmp_path = talloc_asprintf(ctx, "%s%s", dst_path, ".tmp"); + if (!tmp_path) { + DEBUG(3, ("talloc fail\n")); + goto done; + } + unlink(tmp_path); dst_tdb = tdb_open_log(tmp_path, hash_size ? hash_size : tdb_hash_size(src_tdb), @@ -398,6 +403,10 @@ static int tdb_backup_with_rotate(TALLOC_CTX *ctx, const char *src_path, { char *rotate_path = talloc_asprintf(ctx, "%s%s", dst_path, rotate_suffix); + if (rotate_path == NULL) { + DEBUG(10, ("talloc fail\n")); + return -1; + } DEBUG(10, ("backup of %s failed due to lack of space\n", src_path)); DEBUGADD(10, ("trying to free some space by removing rotated " @@ -454,6 +463,10 @@ int tdb_validate_and_backup(const char *tdb_path, } tdb_path_backup = talloc_asprintf(ctx, "%s%s", tdb_path, backup_suffix); + if (!tdb_path_backup) { + DEBUG(0, ("tdb_validate_and_backup: out of memory\n")); + goto done; + } ret = tdb_validate_open(tdb_path, validate_fn); |