X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhameg-hmo%2Fprotocol.c;h=9487bac490c9c26dfeb3e35b1233c30c6568486b;hb=f62f595bfc730070fbf95f7a75c45aef9622fdd4;hp=6f5c0500f00413f5e7d4163db224ac8e7ea4d573;hpb=a1b61e6e04246d7619d3cb7e3c6ab77ab6d2e3d5;p=libsigrok.git 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.");