hameg-hmo: Fix double-free issue.
This commit is contained in:
parent
a1b61e6e04
commit
f62f595bfc
|
@ -672,6 +672,8 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
|
||||||
|
|
||||||
(void)fd;
|
(void)fd;
|
||||||
|
|
||||||
|
data = NULL;
|
||||||
|
|
||||||
if (!(sdi = cb_data))
|
if (!(sdi = cb_data))
|
||||||
return TRUE;
|
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);
|
sr_session_send(cb_data, &packet);
|
||||||
g_slist_free(analog.channels);
|
g_slist_free(analog.channels);
|
||||||
g_array_free(data, TRUE);
|
g_array_free(data, TRUE);
|
||||||
|
data = NULL;
|
||||||
break;
|
break;
|
||||||
case SR_CHANNEL_LOGIC:
|
case SR_CHANNEL_LOGIC:
|
||||||
if (sr_scpi_get_uint8v(sdi->conn, NULL, &data) != SR_OK) {
|
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;
|
packet.payload = &logic;
|
||||||
sr_session_send(cb_data, &packet);
|
sr_session_send(cb_data, &packet);
|
||||||
g_array_free(data, TRUE);
|
g_array_free(data, TRUE);
|
||||||
|
data = NULL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sr_err("Invalid channel type.");
|
sr_err("Invalid channel type.");
|
||||||
|
|
Loading…
Reference in New Issue