]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3620] memory leak in ntpq sysinfo
authorJuergen Perlinger <perlinger@ntp.org>
Thu, 10 Oct 2019 13:26:29 +0000 (15:26 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Thu, 10 Oct 2019 13:26:29 +0000 (15:26 +0200)
bk: 5d9f3185qq-g1S4npf-YHHRlucu1lA

ChangeLog
ntpq/ntpq-subs.c

index d5a490cdc6287526ad2eaa4dbfbf1c699ec5d712..04c546658113ab2e6f33c1457cb78b6b2ea3b067 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
 * [Sec 3610] process_control() should bail earlier on short packets. stenn@
   - Reported by Philippe Antoine
+* [Bug 3620] memory leak in ntpq sysinfo <perlinger@ntp.org>
+  - applied patch by Gerry Garvey
 * [Bug 3619] Honour drefid setting in cooked mode and sysinfo <perlinger@ntp.org>
   - applied patch by Gerry Garvey
 * [Bug 3615] accelerate refclock startup <perlinger@ntp.org>
index ecb1428bca4b427d59ae851036945e22ec32ed57..3020cc5c22a759e9ae5e89b234e3cd8dcb9273fd 100644 (file)
@@ -3874,12 +3874,16 @@ collect_display_vdc(
                        atouint(pvdc->v.str, &ul);
                        xprintf(fp, "%s  %s\n", pvdc->display,
                                modetoa((int)ul));
+                       free(pvdc->v.str);
+                       pvdc->v.str = NULL;
                        break;
 
                case NTP_2BIT:
                        atouint(pvdc->v.str, &ul);
                        xprintf(fp, "%s  %s\n", pvdc->display,
                                leapbits[ul & 0x3]);
+                       free(pvdc->v.str);
+                       pvdc->v.str = NULL;
                        break;
 
                case NTP_REFID: