]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/lecroy-xstream/protocol.c
lecroy-xstream: Fix a potential memory leak.
[libsigrok.git] / src / hardware / lecroy-xstream / protocol.c
index 03cf88ce7e73d42375c79b5644afdb6225e3a2fc..8a2129a71bb28ecd3b5291cba8f1a3e8bcdd8897 100644 (file)
@@ -676,8 +676,10 @@ SR_PRIV int lecroy_xstream_receive_data(int fd, int revents, void *cb_data)
        } else {
                /* Update sample rate if needed. */
                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;
+                       }
        }
 
        /*