]> sigrok.org Git - libsigrok.git/commit
Correctly copy sr_datafeed_meta in sr_packet_copy().
authorAurelien Jacobs <redacted>
Thu, 12 Feb 2015 10:14:37 +0000 (11:14 +0100)
committerAurelien Jacobs <redacted>
Thu, 12 Feb 2015 10:14:37 +0000 (11:14 +0100)
commitee29d92e140a7b516b4ad24b2cd3047bfa5497cd
tree328ff76c2404e4baf8070817839133efd27533af
parentc4f9582714563b1929670061e6d2f87d8a64d152
Correctly copy sr_datafeed_meta in sr_packet_copy().

Commit 5801d558 replaced g_slist_copy_deep() by some incorrect code
that actually leaks the newly allocated memory, instead of doing
a deep copy.

This new version should be more correct, more concise, and it fixes
the following warning:

src/session.c: In function 'sr_packet_copy':
src/session.c:1025:38: warning: passing argument 2 of 'g_slist_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
   g_slist_foreach(meta_copy->config, (GCopyFunc)copy_src, NULL);
                                         ^
In file included from /usr/include/glib-2.0/glib/gmain.h:26:0,
                 from /usr/include/glib-2.0/glib/giochannel.h:33,
                 from /usr/include/glib-2.0/glib.h:54,
                 from src/session.c:24:
/usr/include/glib-2.0/glib/gslist.h:125:10: note: expected 'GFunc {aka void (*)(void *, void *)}' but argument is of type 'void * (*)(const void *, void *)'
void     g_slist_foreach                 (GSList           *list,
         ^
src/session.c