diff -Nru pacemaker-1.1.10+git20130802/debian/changelog pacemaker-1.1.10+git20130802/debian/changelog --- pacemaker-1.1.10+git20130802/debian/changelog 2017-06-02 11:11:13.000000000 -0700 +++ pacemaker-1.1.10+git20130802/debian/changelog 2018-02-02 15:17:19.000000000 -0800 @@ -1,3 +1,10 @@ +pacemaker (1.1.10+git20130802-1ubuntu2.5) trusty; urgency=medium + + * Fixing memory leak (LP: #1316970) + - adding free function where is missing + + -- Seyeong Kim Thu, 01 Feb 2018 19:36:53 +0900 + pacemaker (1.1.10+git20130802-1ubuntu2.4) trusty-security; urgency=medium * SECURITY UPDATE: Improper IPC guarding diff -Nru pacemaker-1.1.10+git20130802/debian/patches/fix_memory_leak.patch pacemaker-1.1.10+git20130802/debian/patches/fix_memory_leak.patch --- pacemaker-1.1.10+git20130802/debian/patches/fix_memory_leak.patch 1969-12-31 16:00:00.000000000 -0800 +++ pacemaker-1.1.10+git20130802/debian/patches/fix_memory_leak.patch 2018-02-02 15:16:17.000000000 -0800 @@ -0,0 +1,117 @@ +Description: Fixing memory leak in upstart.c + 1.1.10 has memory leak. There are many missing free function. + However 1.1.11 has large code changes so I'm modifying code + directly. +Author: Seyeong Kim +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1316970 +Forwarded: not-needed +Last-Update: 2018-02-02 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: pacemaker-1.1.10+git20130802/lib/services/upstart.c +=================================================================== +--- pacemaker-1.1.10+git20130802.orig/lib/services/upstart.c 2013-07-31 22:46:22.000000000 -0700 ++++ pacemaker-1.1.10+git20130802/lib/services/upstart.c 2018-02-02 15:16:10.054838739 -0800 +@@ -160,7 +160,7 @@ + GList *units = NULL; + GError *error = NULL; + GVariantIter *iter; +- char *path = NULL; ++ gchar *path = NULL; + GVariant *_ret = NULL; + int lpc = 0; + +@@ -200,13 +200,14 @@ + + g_variant_iter_free(iter); + g_variant_unref(_ret); ++ g_free(path); + return units; + } + + gboolean + upstart_job_exists(const char *name) + { +- char *path = NULL; ++ gchar *path = NULL; + GError *error = NULL; + gboolean pass = FALSE; + +@@ -224,7 +225,7 @@ + } else if (pass) { + crm_trace("Got %s", path); + } +- /* free(path) */ ++ g_free(path); + return pass; + } + +@@ -272,6 +273,7 @@ + + g_object_unref(proxy); + g_variant_unref(_ret); ++ g_variant_unref(asv); + return output; + } + +@@ -299,18 +301,21 @@ + GVariant *tmp2 = g_variant_get_child_value(tmp1, 0); + + instance = g_variant_dup_string(tmp2, NULL); ++ g_variant_unref(tmp2); + } ++ g_variant_unref(tmp1); + } + + crm_info("Result: %s", instance); + g_variant_unref(_ret); ++ g_object_unref(proxy); + return instance; + } + + gboolean + upstart_job_running(const gchar * name) + { +- char *job = NULL; ++ gchar *job = NULL; + GError *error = NULL; + gboolean pass = FALSE; + +@@ -338,6 +343,7 @@ + } + + crm_info("%s is%s running", name, pass ? "" : " not"); ++ g_free(job); + return pass; + } + +@@ -394,12 +400,13 @@ + g_error_free(error); + + } else if(g_variant_is_of_type (_ret, G_VARIANT_TYPE("(o)"))) { +- char *path = NULL; ++ gchar *path = NULL; + + g_variant_get(_ret, "(o)", &path); + crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret), + path); + op->rc = PCMK_EXECRA_OK; ++ g_free(path); + + } else { + crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret)); +@@ -495,12 +502,13 @@ + } + + } else if(g_variant_is_of_type (_ret, G_VARIANT_TYPE("(o)"))) { +- char *path = NULL; ++ gchar *path = NULL; + + g_variant_get(_ret, "(o)", &path); + crm_info("Call to %s passed: type '%s' %s", op->action, g_variant_get_type_string(_ret), + path); + op->rc = PCMK_EXECRA_OK; ++ g_free(path); + + } else { + crm_err("Call to %s passed but return type was '%s' not '(o)'", op->action, g_variant_get_type_string(_ret)); diff -Nru pacemaker-1.1.10+git20130802/debian/patches/series pacemaker-1.1.10+git20130802/debian/patches/series --- pacemaker-1.1.10+git20130802/debian/patches/series 2017-06-02 11:10:56.000000000 -0700 +++ pacemaker-1.1.10+git20130802/debian/patches/series 2018-02-01 02:35:22.000000000 -0800 @@ -8,3 +8,4 @@ Fix-services-Fixes-segfault-associated-with-cancelling-inflight-operations.patch Fix-services-Remove-cancelled-recurring-ops-from-internal-lists.patch CVE-2016-7035.patch +fix_memory_leak.patch