The branch, master has been updated
       via  6446c75... Fix several places where talloc_asprintf returns were 
unchecked.
      from  1890a2a... WHATSNEW: Update changes.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6446c75f70fcb80c9d66fd7d6d9cfdd01157c385
Author: Jeremy Allison <j...@samba.org>
Date:   Tue Jul 27 02:36:57 2010 -0700

    Fix several places where talloc_asprintf returns were unchecked.
    
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/tdb_validate.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/tdb_validate.c b/source3/lib/tdb_validate.c
index c5cb1b4..e001d9c 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);
 


-- 
Samba Shared Repository

Reply via email to