Mercurial > hg > th-libs
comparison th_ioctx_mem.c @ 720:ff724f45162a
Add th_ioctx::memData NULL check in th_mem_realloc() as well.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 11 Nov 2020 15:08:03 +0200 |
parents | d51c277bea6b |
children | 4ca6a3b30fe8 |
comparison
equal
deleted
inserted
replaced
719:d51c277bea6b | 720:ff724f45162a |
---|---|
62 if (!ctx->memWrite) | 62 if (!ctx->memWrite) |
63 { | 63 { |
64 ctx->status = THERR_FWRITE; | 64 ctx->status = THERR_FWRITE; |
65 return FALSE; | 65 return FALSE; |
66 } | 66 } |
67 | |
68 if (ctx->memData == NULL) | |
69 ctx->memAlloc = 0; | |
67 | 70 |
68 // Check against max size | 71 // Check against max size |
69 if (ctx->maxSize > 0 && newSize > ctx->maxSize) | 72 if (ctx->maxSize > 0 && newSize > ctx->maxSize) |
70 { | 73 { |
71 ctx->status = THERR_BOUNDS; | 74 ctx->status = THERR_BOUNDS; |