mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-11 03:21:29 +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 {
|
} else {
|
||||||
report_error(translate("gettextFromC", "[Error] Out of memory for dive %d. Abort parsing."), dt_dive->number);
|
report_error(translate("gettextFromC", "[Error] Out of memory for dive %d. Abort parsing."), dt_dive->number);
|
||||||
free(compl_buffer);
|
free(compl_buffer);
|
||||||
free(devdata);
|
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
if (is_nitrox)
|
if (is_nitrox)
|
||||||
|
@ -566,6 +565,7 @@ unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive)
|
||||||
free(devdata);
|
free(devdata);
|
||||||
return membuf;
|
return membuf;
|
||||||
bail:
|
bail:
|
||||||
|
free(devdata);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue