hameg-hmo: Fix double-free issue.

This commit is contained in:
Mathias Katzer 2015-01-11 01:39:41 +01:00 committed by Uwe Hermann
parent a1b61e6e04
commit f62f595bfc
1 changed files with 4 additions and 0 deletions

View File

@ -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.");