mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Cleanup: avoid memory leak
The JUMP macro includes a 'goto bail', so we need to free devdata there Coverity CID 208340 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2c8614e43e
commit
efb2640fc7
1 changed files with 1 additions and 1 deletions
|
@ -538,7 +538,6 @@ unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive)
|
|||
} else {
|
||||
report_error(translate("gettextFromC", "[Error] Out of memory for dive %d. Abort parsing."), dt_dive->number);
|
||||
free(compl_buffer);
|
||||
free(devdata);
|
||||
goto bail;
|
||||
}
|
||||
if (is_nitrox)
|
||||
|
@ -566,6 +565,7 @@ unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive)
|
|||
free(devdata);
|
||||
return membuf;
|
||||
bail:
|
||||
free(devdata);
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue