Skip to content

Commit

Permalink
Another one
Browse files Browse the repository at this point in the history
  • Loading branch information
adeyblue committed Dec 11, 2019
1 parent dbe4839 commit b0f84d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rtlib/array_redimpresv.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ int fb_hArrayRealloc
ssize_t lbTB[FB_MAXDIMENSIONS];
ssize_t ubTB[FB_MAXDIMENSIONS];
unsigned char *this_;
void *reallocTemp;

/* ditto, see fb_hArrayAlloc() */
if( (dimensions != array->dimensions) && (array->dimensions != 0) )
Expand Down Expand Up @@ -52,10 +53,11 @@ int fb_hArrayRealloc
size = elements * element_len;

/* realloc */
array->ptr = realloc( array->ptr, size );
if( array->ptr == NULL )
reallocTemp = realloc( array->ptr, size );
if( reallocTemp == NULL )
return fb_ErrorSetNum( FB_RTERROR_OUTOFMEM );

array->ptr = reallocTemp;
/* Have remainder? */
if( size > array->size ) {
/* Construct or clear new array elements: */
Expand Down

0 comments on commit b0f84d7

Please sign in to comment.