diff options
Diffstat (limited to 'source3')
-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); |