From 551176911fae1456265a39ed83936a2a433e59c6 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Wed, 3 Jul 2013 20:34:30 +0200 Subject: [PATCH] fix memory leaks in error case --- mbus/mbus-protocol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mbus/mbus-protocol.c b/mbus/mbus-protocol.c index 8109c8d..81739e1 100755 --- a/mbus/mbus-protocol.c +++ b/mbus/mbus-protocol.c @@ -4047,11 +4047,13 @@ mbus_frame_get_secondary_address(mbus_frame *frame) if (frame->control_information != MBUS_CONTROL_INFO_RESP_VARIABLE) { snprintf(error_str, sizeof(error_str), "Non-variable data response (can't get secondary address from response)."); + mbus_frame_data_free(data); return NULL; } if (mbus_frame_data_parse(frame, data) == -1) { + mbus_frame_data_free(data); return NULL; }