s3-tdb: Added missing out of memory check in rename_file_with_suffix().
authorAndreas Schneider <asn@samba.org>
Tue, 15 Jun 2010 12:25:12 +0000 (14:25 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 16 Jun 2010 12:31:40 +0000 (14:31 +0200)
source3/lib/tdb_validate.c

index b4d0365dd4fd4fdf684b8fb47ecb764b840729fa..c5cb1b44d4c6a027782b38bfe1ddefde53ecfa3a 100644 (file)
@@ -355,6 +355,10 @@ static int rename_file_with_suffix(TALLOC_CTX *ctx, const char *path,
        char *dst_path;
 
        dst_path = talloc_asprintf(ctx, "%s%s", path, suffix);
+       if (dst_path == NULL) {
+               DEBUG(3, ("error out of memory\n"));
+               return ret;
+       }
 
        ret = (rename(path, dst_path) != 0);