From: Mathias Katzer Date: Sun, 11 Jan 2015 00:39:41 +0000 (+0100) Subject: hameg-hmo: Fix double-free issue. X-Git-Tag: libsigrok-0.4.0~687 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f62f595bfc730070fbf95f7a75c45aef9622fdd4;p=libsigrok.git hameg-hmo: Fix double-free issue. --- diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c index 6f5c0500..9487bac4 100644 --- a/src/hardware/hameg-hmo/protocol.c +++ b/src/hardware/hameg-hmo/protocol.c @@ -672,6 +672,8 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) (void)fd; + data = NULL; + if (!(sdi = cb_data)) return TRUE; @@ -704,6 +706,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) sr_session_send(cb_data, &packet); g_slist_free(analog.channels); g_array_free(data, TRUE); + data = NULL; break; case SR_CHANNEL_LOGIC: if (sr_scpi_get_uint8v(sdi->conn, NULL, &data) != SR_OK) { @@ -722,6 +725,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) packet.payload = &logic; sr_session_send(cb_data, &packet); g_array_free(data, TRUE); + data = NULL; break; default: sr_err("Invalid channel type.");