Resolves: #2013934 - fix mem leak when verbose mode is on
This commit is contained in:
parent
d7d8b27d08
commit
c7152d55c9
19
0002-mem-leak-verbose.patch
Normal file
19
0002-mem-leak-verbose.patch
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
diff -ruNp a/src/run-as-child.c b/src/run-as-child.c
|
||||||
|
--- a/src/run-as-child.c 2021-10-14 08:17:04.556107815 +0200
|
||||||
|
+++ b/src/run-as-child.c 2021-10-14 08:36:23.686706344 +0200
|
||||||
|
@@ -98,8 +98,14 @@ int exec_as_func(int flags, void *ptr)
|
||||||
|
/* Create single string with all command line options. */
|
||||||
|
int ii = 1;
|
||||||
|
char *opt = strdup(":");
|
||||||
|
+ char *tempOpt;
|
||||||
|
while (opt != NULL && arg[ii] != NULL) {
|
||||||
|
- opt = realloc(opt, strlen(opt) + strlen(arg[ii]) + 2);
|
||||||
|
+ tempOpt = realloc(opt, strlen(opt) + strlen(arg[ii]) + 2);
|
||||||
|
+ if (tempOpt != NULL){
|
||||||
|
+ opt = tempOpt;
|
||||||
|
+ } else {
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
opt = strcat(opt, " ");
|
||||||
|
opt = strcat(opt, arg[ii]);
|
||||||
|
ii++;
|
@ -1,7 +1,7 @@
|
|||||||
Summary: Software and/or Hardware watchdog daemon
|
Summary: Software and/or Hardware watchdog daemon
|
||||||
Name: watchdog
|
Name: watchdog
|
||||||
Version: 5.16
|
Version: 5.16
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
|
|
||||||
URL: http://sourceforge.net/projects/watchdog/
|
URL: http://sourceforge.net/projects/watchdog/
|
||||||
@ -13,6 +13,8 @@ Source5: watchdog-ping.service
|
|||||||
|
|
||||||
# Fixes building on glibc without RPC. Sent upstream 2019-02-06.
|
# Fixes building on glibc without RPC. Sent upstream 2019-02-06.
|
||||||
Patch1: 0001-Choose-libtirpc-or-another-RPC-library-for-XDR-heade.patch
|
Patch1: 0001-Choose-libtirpc-or-another-RPC-library-for-XDR-heade.patch
|
||||||
|
# Fixes potentional mem leak
|
||||||
|
Patch2: 0002-mem-leak-verbose.patch
|
||||||
|
|
||||||
# Non-upstream patch to document SELinux support.
|
# Non-upstream patch to document SELinux support.
|
||||||
Patch99: 0099-watchdog-5.16-rhseldoc.patch
|
Patch99: 0099-watchdog-5.16-rhseldoc.patch
|
||||||
@ -49,6 +51,7 @@ expiration) initiated by the BMC.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}
|
%setup -q -n %{name}-%{version}
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
%patch99 -p1 -b .rhseldoc
|
%patch99 -p1 -b .rhseldoc
|
||||||
autoreconf -i
|
autoreconf -i
|
||||||
|
|
||||||
@ -124,6 +127,9 @@ rm %{name}.sysconfig
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Oct 14 2021 Josef Ridky <jridky@redhat.com> - 5.16-2
|
||||||
|
- fix memory leak when verbose mode is on
|
||||||
|
|
||||||
* Tue Aug 10 2021 Josef Ridky <jridky@redhat.com> - 5.16-1
|
* Tue Aug 10 2021 Josef Ridky <jridky@redhat.com> - 5.16-1
|
||||||
- New upstream release 5.16
|
- New upstream release 5.16
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user