lecroy-xstream: Fix a potential memory leak.
Reported by scan-build: src/hardware/lecroy-xstream/protocol.c:680:12: warning: Potential leak of memory pointed to by 'analog.data' return SR_ERR; ^~~~~~
This commit is contained in:
parent
4fc4b8e7aa
commit
d5db6ea7e1
|
@ -676,8 +676,10 @@ SR_PRIV int lecroy_xstream_receive_data(int fd, int revents, void *cb_data)
|
||||||
} else {
|
} else {
|
||||||
/* Update sample rate if needed. */
|
/* Update sample rate if needed. */
|
||||||
if (state->sample_rate == 0)
|
if (state->sample_rate == 0)
|
||||||
if (lecroy_xstream_update_sample_rate(sdi, analog.num_samples) != SR_OK)
|
if (lecroy_xstream_update_sample_rate(sdi, analog.num_samples) != SR_OK) {
|
||||||
|
g_free(analog.data);
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue