From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5AD89138334 for ; Thu, 28 Jun 2018 18:03:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7EBACE08C9; Thu, 28 Jun 2018 18:03:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 34E56E08C9 for ; Thu, 28 Jun 2018 18:03:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A125B335C71 for ; Thu, 28 Jun 2018 18:03:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C3D112E3 for ; Thu, 28 Jun 2018 18:03:31 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1530119179.3a803b3135837665d51ef4dd7a8b913c78e71ff6.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/librc/librc-daemon.c X-VCS-Directories: src/librc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 3a803b3135837665d51ef4dd7a8b913c78e71ff6 X-VCS-Branch: master Date: Thu, 28 Jun 2018 18:03:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c68bd7fa-9031-4b08-974b-4c92196832cc X-Archives-Hash: 8d7369aa47f42fa82d02163adb63eb7c commit: 3a803b3135837665d51ef4dd7a8b913c78e71ff6 Author: William Hubbs gmail com> AuthorDate: Wed Jun 27 17:06:19 2018 +0000 Commit: William Hubbs gentoo org> CommitDate: Wed Jun 27 17:06:19 2018 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=3a803b31 librc-daemon.c: fix memory leaks src/librc/librc-daemon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c index 173fcb83..6f3b492f 100644 --- a/src/librc/librc-daemon.c +++ b/src/librc/librc-daemon.c @@ -422,6 +422,7 @@ rc_service_daemon_set(const char *service, const char *exec, rename(file, oldfile); strlcpy(oldfile, file, sizeof(oldfile)); } + free(file); } closedir(dp); rc_stringlist_free(match); @@ -446,10 +447,12 @@ rc_service_daemon_set(const char *service, const char *exec, fclose(fp); retval = true; } + free(file); } } else retval = true; + free(dirpath); return retval; } librc_hidden_def(rc_service_daemon_set)