aboutsummaryrefslogtreecommitdiff
path: root/src/mm-port-serial-at.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-07-18 11:28:33 +0200
committerAleksander Morgado <aleksander@aleksander.es>2017-07-18 11:28:33 +0200
commitbad79cb5e1063fcb269543c07a7be5b32762b3cb (patch)
treeca9432babce69520c0b7d375fff1409af20b4241 /src/mm-port-serial-at.c
parentfa31b699ece5dbc64600b7a41364d5167f98ef5e (diff)
port-serial: plug memleak on error processing
==28664== 216 (120 direct, 96 indirect) bytes in 5 blocks are definitely lost in loss record 4,109 of 4,317 ==28664== at 0x4C2BEEF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==28664== by 0x644E018: g_malloc (in /usr/lib/libglib-2.0.so.0.5200.2) ==28664== by 0x6465B05: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.5200.2) ==28664== by 0x6469C32: g_string_sized_new (in /usr/lib/libglib-2.0.so.0.5200.2) ==28664== by 0x4D7861: parse_response (mm-port-serial-at.c:142) ==28664== by 0x4D3B52: parse_response_buffer (mm-port-serial.c:857) ==28664== by 0x4D40F2: common_input_available (mm-port-serial.c:981) ==28664== by 0x4D41B4: iochannel_input_available (mm-port-serial.c:1004) ==28664== by 0x64488B4: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.5200.2) ==28664== by 0x6448C77: ??? (in /usr/lib/libglib-2.0.so.0.5200.2) ==28664== by 0x6448F91: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.5200.2) ==28664== by 0x438035: main (main.c:180)
Diffstat (limited to 'src/mm-port-serial-at.c')
-rw-r--r--src/mm-port-serial-at.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mm-port-serial-at.c b/src/mm-port-serial-at.c
index fb2174da..fef910e5 100644
--- a/src/mm-port-serial-at.c
+++ b/src/mm-port-serial-at.c
@@ -157,6 +157,7 @@ parse_response (MMPortSerial *port,
/* If we got an error, propagate it without any further response string */
if (inner_error) {
+ g_string_free (string, TRUE);
g_propagate_error (error, inner_error);
return MM_PORT_SERIAL_RESPONSE_ERROR;
}