File pacemaker-libcrmcommon-avoid-memory-leak-when-schema-transform-not-found.patch of Package pacemaker.14737
commit d2c2bf04693899dcfe79be024faf72f02adfb419
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Fri Mar 2 09:48:28 2018 -0600
Low: libcrmcommon: avoid memory leak when schema transform not found
Index: pacemaker/lib/common/xml.c
===================================================================
--- pacemaker.orig/lib/common/xml.c
+++ pacemaker/lib/common/xml.c
@@ -425,16 +425,19 @@ static int __xml_build_schema_list(void)
next = -1;
}
__xml_schema_add(2, version, NULL, NULL, transform, next);
- free(namelist[lpc]);
free(transform);
}
+
+ for (lpc = 0; lpc < max; lpc++) {
+ free(namelist[lpc]);
+ }
+ free(namelist);
}
/* 1.1 was the old name for -next */
__xml_schema_add(2, zero, "pacemaker-1.1", "pacemaker-next.rng", NULL, 0);
__xml_schema_add(2, zero, "pacemaker-next", "pacemaker-next.rng", NULL, -1);
__xml_schema_add(0, zero, "none", "N/A", NULL, -1);
- free(namelist);
return TRUE;
}