device.c: Fix memory leak in sr_serial_dev_inst_free

sr_serial_dev_inst_free() freed all members of sr_serial_dev_inst, but did not
free the struct itself, as expected from a free_*() function. This inadvertently
caused a memory leak in every place sr_serial_dev_inst is used.

Free the struct itself

+	g_free(serial);

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
This commit is contained in:
Alexandru Gagniuc 2012-12-19 21:39:38 -06:00 committed by Uwe Hermann
parent d55c89f523
commit acac8fc350
1 changed files with 1 additions and 0 deletions

View File

@ -325,6 +325,7 @@ SR_PRIV void sr_serial_dev_inst_free(struct sr_serial_dev_inst *serial)
g_free(serial->port); g_free(serial->port);
g_free(serial->serialcomm); g_free(serial->serialcomm);
g_free(serial);
} }