]> sigrok.org Git - libsigrok.git/commitdiff
beaglelogic: fixup memory leak in the TCP command send routine
authorGerhard Sittig <redacted>
Thu, 8 Feb 2018 21:22:56 +0000 (22:22 +0100)
committerUwe Hermann <redacted>
Fri, 9 Feb 2018 20:34:17 +0000 (21:34 +0100)
Release allocated memory in an error code path.

This was reported by clang's scan-build.

src/hardware/beaglelogic/beaglelogic_tcp.c

index 9e7d00762611f82871f01a7af87d7243dd946a5d..24355240ceb89569ddd2749e55110c5da77aa4c7 100644 (file)
@@ -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;
        }