From 96e6bf5848f73d2feba730b9c0a266c94d841637 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 4 Jan 2018 08:50:17 -0800 Subject: [PATCH] Cleanup: avoid memory leaks Coverity CID 207730 Coverity CID 207747 Signed-off-by: Dirk Hohndel --- src/suunto_eonsteel_parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/suunto_eonsteel_parser.c b/src/suunto_eonsteel_parser.c index 8654831..d70d9f3 100644 --- a/src/suunto_eonsteel_parser.c +++ b/src/suunto_eonsteel_parser.c @@ -834,10 +834,12 @@ static void sample_setpoint_type(const struct type_desc *desc, struct sample_dat sample.ppo2 = info->eon->cache.customsetpoint; else { DEBUG(info->eon->base.context, "sample_setpoint_type(%u) unknown type '%s'", value, type); + free((void *)type); return; } if (info->callback) info->callback(DC_SAMPLE_SETPOINT, sample, info->userdata); + free((void *)type); } // uint32 @@ -1168,6 +1170,7 @@ static int add_gas_type(suunto_eonsteel_parser_t *eon, const struct type_desc *d eon->cache.initialized |= 1 << DC_FIELD_GASMIX_COUNT; eon->cache.initialized |= 1 << DC_FIELD_TANK_COUNT; + free((void *)name); return 0; }