diff options
-rw-r--r-- | datatrak.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/datatrak.h b/datatrak.h index 1b518ce10..3a37e0465 100644 --- a/datatrak.h +++ b/datatrak.h @@ -31,8 +31,10 @@ typedef struct dtrakheader_ { #define read_string(_property) \ unsigned char *_property##tmp = (unsigned char *)calloc(tmp_1byte + 1, 1); \ - if (fread((char *)_property##tmp, 1, tmp_1byte, archivo) != tmp_1byte) \ + if (fread((char *)_property##tmp, 1, tmp_1byte, archivo) != tmp_1byte) { \ + free(_property##tmp); \ goto bail; \ + } \ _property = (unsigned char *)strcat(to_utf8(_property##tmp), ""); \ free(_property##tmp); |