pidgin/pidgin

Fix leak in `purple_markup_find_tag` on error
release-2.x.y
2021-09-15, Elliott Sales de Andrade
addb2327cde0
Parents 581ae0eecd0d
Children cb21c7484e4c
Fix leak in `purple_markup_find_tag` on error

The output is set to `NULL`, but the internal data list is not freed if it happened to get something put into it.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35816

Testing Done:
Ran `pidgin_utils_fuzzer` on the test case in the bug report.

Reviewed at https://reviews.imfreedom.org/r/924/
--- a/libpurple/util.c Tue Sep 14 19:24:43 2021 -0500
+++ b/libpurple/util.c Wed Sep 15 13:11:17 2021 -0500
@@ -1249,6 +1249,7 @@
*start = NULL;
*end = NULL;
*attributes = NULL;
+ g_datalist_clear(&attribs);
}
return found;