From: Gerhard Sittig Date: Thu, 8 Feb 2018 21:22:56 +0000 (+0100) Subject: beaglelogic: fixup memory leak in the TCP command send routine X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=71f2000bfb01f69638883b1ec5540d82b11099e6;p=libsigrok.git beaglelogic: fixup memory leak in the TCP command send routine Release allocated memory in an error code path. This was reported by clang's scan-build. --- diff --git a/src/hardware/beaglelogic/beaglelogic_tcp.c b/src/hardware/beaglelogic/beaglelogic_tcp.c index 9e7d0076..24355240 100644 --- a/src/hardware/beaglelogic/beaglelogic_tcp.c +++ b/src/hardware/beaglelogic/beaglelogic_tcp.c @@ -107,6 +107,7 @@ static int beaglelogic_tcp_send_cmd(struct dev_context *devc, if (out < 0) { sr_err("Send error: %s", g_strerror(errno)); + g_free(buf); return SR_ERR; }