mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: avoid resource leak
That code was obviously wrong from the start. Fixes CID 373921 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
cffcce77bb
commit
61e8ceef05
1 changed files with 3 additions and 1 deletions
|
@ -609,12 +609,14 @@ static void save_one_device(struct membuffer *b, const struct device *d)
|
|||
|
||||
static void save_one_fingerprint(struct membuffer *b, int i)
|
||||
{
|
||||
const char *data = fp_get_data(&fingerprint_table, i);
|
||||
put_format(b, "<fingerprint model='%08x' serial='%08x' deviceid='%08x' diveid='%08x' data='%s'/>\n",
|
||||
fp_get_model(&fingerprint_table, i),
|
||||
fp_get_serial(&fingerprint_table, i),
|
||||
fp_get_deviceid(&fingerprint_table, i),
|
||||
fp_get_diveid(&fingerprint_table, i),
|
||||
fp_get_data(&fingerprint_table, i));
|
||||
data);
|
||||
free((void *)data);
|
||||
}
|
||||
|
||||
int save_dives(const char *filename)
|
||||
|
|
Loading…
Add table
Reference in a new issue