From: Martin Ling Date: Sat, 5 Sep 2015 17:03:23 +0000 (+0100) Subject: sr_packet_copy: Allocate memory to copy analog data. X-Git-Tag: libsigrok-0.4.0~269 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=39e0113533dedca8f929fcf682881f1c5afee362;p=libsigrok.git sr_packet_copy: Allocate memory to copy analog data. --- diff --git a/src/session.c b/src/session.c index 8211438e..113b31b7 100644 --- a/src/session.c +++ b/src/session.c @@ -1285,6 +1285,7 @@ SR_PRIV int sr_packet_copy(const struct sr_datafeed_packet *packet, analog_copy->mq = analog->mq; analog_copy->unit = analog->unit; analog_copy->mqflags = analog->mqflags; + analog_copy->data = g_malloc(analog->num_samples * sizeof(float)); memcpy(analog_copy->data, analog->data, analog->num_samples * sizeof(float)); (*copy)->payload = analog_copy;