]> sigrok.org Git - libsigrok.git/blobdiff - src/trigger.c
Build: Include <config.h> first in all source files
[libsigrok.git] / src / trigger.c
index 34474982b678de0bc5144a5553f7a0b51a3c65ed..8a800b8607837c45256de09f37783f08a944fc7b 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 
@@ -80,7 +81,9 @@ SR_API void sr_trigger_free(struct sr_trigger *trig)
 
        for (l = trig->stages; l; l = l->next) {
                stage = l->data;
-               g_slist_free_full(stage->matches, g_free);
+
+               if (stage->matches)
+                       g_slist_free_full(stage->matches, g_free);
        }
        g_slist_free_full(trig->stages, g_free);