s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
[nivanova/samba-autobuild/.git] / source3 / lib / dbwrap_file.c
index e3779de1e47effda998f93ba7b996cc0243a5f44..6ecd72810deeea1d979e7b1819d7f18018f2007c 100644 (file)
@@ -80,12 +80,12 @@ static struct db_record *db_file_fetch_locked(struct db_context *db,
        SMB_ASSERT(ctx->locked_record == NULL);
 
  again:
        SMB_ASSERT(ctx->locked_record == NULL);
 
  again:
-       if (!(result = TALLOC_P(mem_ctx, struct db_record))) {
+       if (!(result = talloc(mem_ctx, struct db_record))) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
 
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
 
-       if (!(file = TALLOC_P(result, struct db_locked_file))) {
+       if (!(file = talloc(result, struct db_locked_file))) {
                DEBUG(0, ("talloc failed\n"));
                TALLOC_FREE(result);
                return NULL;
                DEBUG(0, ("talloc failed\n"));
                TALLOC_FREE(result);
                return NULL;
@@ -105,7 +105,7 @@ static struct db_record *db_file_fetch_locked(struct db_context *db,
 
        /* Cut to 8 bits */
        file->hash = fsh(key.dptr, key.dsize);
 
        /* Cut to 8 bits */
        file->hash = fsh(key.dptr, key.dsize);
-       file->name = hex_encode(file, (unsigned char *)key.dptr, key.dsize);
+       file->name = hex_encode_talloc(file, (unsigned char *)key.dptr, key.dsize);
        if (file->name == NULL) {
                DEBUG(0, ("hex_encode failed\n"));
                TALLOC_FREE(result);
        if (file->name == NULL) {
                DEBUG(0, ("hex_encode failed\n"));
                TALLOC_FREE(result);
@@ -168,7 +168,7 @@ static struct db_record *db_file_fetch_locked(struct db_context *db,
 
        if (statbuf.st_size != 0) {
                result->value.dsize = statbuf.st_size;
 
        if (statbuf.st_size != 0) {
                result->value.dsize = statbuf.st_size;
-               result->value.dptr = TALLOC_ARRAY(result, uint8,
+               result->value.dptr = talloc_array(result, uint8,
                                                  statbuf.st_size);
                if (result->value.dptr == NULL) {
                        DEBUG(1, ("talloc failed\n"));
                                                  statbuf.st_size);
                if (result->value.dptr == NULL) {
                        DEBUG(1, ("talloc failed\n"));
@@ -348,12 +348,12 @@ struct db_context *db_open_file(TALLOC_CTX *mem_ctx,
        struct db_context *result = NULL;
        struct db_file_ctx *ctx;
 
        struct db_context *result = NULL;
        struct db_file_ctx *ctx;
 
-       if (!(result = TALLOC_ZERO_P(mem_ctx, struct db_context))) {
+       if (!(result = talloc_zero(mem_ctx, struct db_context))) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
 
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
 
-       if (!(ctx = TALLOC_P(result, struct db_file_ctx))) {
+       if (!(ctx = talloc(result, struct db_file_ctx))) {
                DEBUG(0, ("talloc failed\n"));
                TALLOC_FREE(result);
                return NULL;
                DEBUG(0, ("talloc failed\n"));
                TALLOC_FREE(result);
                return NULL;