summaryrefslogtreecommitdiff
path: root/lib/tdb/common
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tdb/common')
-rw-r--r--lib/tdb/common/transaction.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c
index 42289fd0f6..a2498ec82d 100644
--- a/lib/tdb/common/transaction.c
+++ b/lib/tdb/common/transaction.c
@@ -249,14 +249,8 @@ static int transaction_write(struct tdb_context *tdb, tdb_off_t off,
if (tdb->transaction->num_blocks <= blk) {
uint8_t **new_blocks;
/* expand the blocks array */
- if (tdb->transaction->blocks == NULL) {
- new_blocks = (uint8_t **)malloc(
- (blk+1)*sizeof(uint8_t *));
- } else {
- new_blocks = (uint8_t **)realloc(
- tdb->transaction->blocks,
- (blk+1)*sizeof(uint8_t *));
- }
+ new_blocks = (uint8_t **)realloc(tdb->transaction->blocks,
+ (blk+1)*sizeof(uint8_t *));
if (new_blocks == NULL) {
tdb->ecode = TDB_ERR_OOM;
goto fail;