merged changes from v3-2-test
[samba.git] / source4 / lib / tdb / common / transaction.c
index ea0e3a93f3d46c2ccd835b95a3313afb3911f987..c3e7a4e2c065d55492fbc9ddb3c1ff6946bf7057 100644 (file)
@@ -219,9 +219,12 @@ static int transaction_write(struct tdb_context *tdb, tdb_off_t off,
                uint8_t **new_blocks;
                /* expand the blocks array */
                if (tdb->transaction->blocks == NULL) {
-                       new_blocks = malloc((blk+1)*sizeof(uint8_t *));
+                       new_blocks = (uint8_t **)malloc(
+                               (blk+1)*sizeof(uint8_t *));
                } else {
-                       new_blocks = 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;