mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Avoid resource leak
Coverity CID 1307997 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7d8a36820d
commit
15a55b9648
1 changed files with 4 additions and 3 deletions
|
@ -27,8 +27,9 @@ typedef struct dtrakheader_ {
|
|||
}
|
||||
|
||||
#define read_string(_property) \
|
||||
_property = (unsigned char *)calloc(tmp_1byte + 1, 1); \
|
||||
fread((char *)_property, 1, tmp_1byte, archivo); \
|
||||
_property = (unsigned char *)strcat(to_utf8(_property), "");
|
||||
unsigned char *_property##tmp = (unsigned char *)calloc(tmp_1byte + 1, 1); \
|
||||
fread((char *)_property##tmp, 1, tmp_1byte, archivo); \
|
||||
_property = (unsigned char *)strcat(to_utf8(_property##tmp), ""); \
|
||||
free(_property##tmp);
|
||||
|
||||
#endif // DATATRAK_HEADER_H
|
||||
|
|
Loading…
Add table
Reference in a new issue