diff options
-rw-r--r-- | meta-networking/recipes-daemons/ptpd/ptpd/0001-ptpd-Solve-memory-leak-for-function-NTPDCrequest.patch | 40 | ||||
-rw-r--r-- | meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb | 1 |
2 files changed, 41 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/ptpd/ptpd/0001-ptpd-Solve-memory-leak-for-function-NTPDCrequest.patch b/meta-networking/recipes-daemons/ptpd/ptpd/0001-ptpd-Solve-memory-leak-for-function-NTPDCrequest.patch new file mode 100644 index 0000000000..b2caeba2ca --- /dev/null +++ b/meta-networking/recipes-daemons/ptpd/ptpd/0001-ptpd-Solve-memory-leak-for-function-NTPDCrequest.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 3886219c5c1fdca114dd480b46ce211762e30742 Mon Sep 17 00:00:00 2001 | ||
2 | From: Li Zhou <li.zhou@windriver.com> | ||
3 | Date: Tue, 30 Jun 2020 13:50:11 +0800 | ||
4 | Subject: [PATCH] ptpd: Solve memory leak for function NTPDCrequest | ||
5 | |||
6 | Solve the memory leak in function NTPDCrequest detected by valgrind tool. | ||
7 | |||
8 | Memory leak log example: | ||
9 | ==619== 21 bytes in 1 blocks are still reachable in loss record 1 of 3 | ||
10 | ==619== at 0x4A09DB0: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) | ||
11 | ==619== by 0x43512E: NTPDCrequest (ntpdcontrol.c:255) | ||
12 | ==619== by 0x43512E: NTPDCquery.isra.1 (ntpdcontrol.c:683) | ||
13 | ==619== by 0x4359EE: ntpdInControl (ntpdcontrol.c:807) | ||
14 | ==619== by 0x4364F5: ntpServiceUpdate (timingdomain.c:622) | ||
15 | ==619== by 0x436935: timingDomainUpdate (timingdomain.c:756) | ||
16 | ==619== by 0x4334A7: protocol (protocol.c:263) | ||
17 | ==619== by 0x402BAE: main (ptpd.c:131) | ||
18 | |||
19 | Upstream-Status: Pending | ||
20 | |||
21 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
22 | --- | ||
23 | src/dep/ntpengine/ntpdcontrol.c | 1 + | ||
24 | 1 file changed, 1 insertion(+) | ||
25 | |||
26 | diff --git a/src/dep/ntpengine/ntpdcontrol.c b/src/dep/ntpengine/ntpdcontrol.c | ||
27 | index bfe0b5e..b1973cb 100644 | ||
28 | --- a/src/dep/ntpengine/ntpdcontrol.c | ||
29 | +++ b/src/dep/ntpengine/ntpdcontrol.c | ||
30 | @@ -271,6 +271,7 @@ NTPDCrequest( | ||
31 | |||
32 | if (!auth) { | ||
33 | qpkt.auth_seq = AUTH_SEQ(0, 0); | ||
34 | + free(key); | ||
35 | return ntpSend(control, (Octet *)&qpkt, req_pkt_size); | ||
36 | } | ||
37 | |||
38 | -- | ||
39 | 1.9.1 | ||
40 | |||
diff --git a/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb b/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb index cab0d9435f..227c9f9170 100644 --- a/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb +++ b/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb | |||
@@ -24,6 +24,7 @@ def get_sub(d): | |||
24 | SRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${@get_sub(d)}/ptpd-${PV}.tar.gz \ | 24 | SRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${@get_sub(d)}/ptpd-${PV}.tar.gz \ |
25 | file://ptpd-use-pkgconfig.patch \ | 25 | file://ptpd-use-pkgconfig.patch \ |
26 | file://Fixed-100-CPU-using-issue-by-adding-minimum-POSIX-ti.patch \ | 26 | file://Fixed-100-CPU-using-issue-by-adding-minimum-POSIX-ti.patch \ |
27 | file://0001-ptpd-Solve-memory-leak-for-function-NTPDCrequest.patch \ | ||
27 | file://ptpd.service \ | 28 | file://ptpd.service \ |
28 | file://ptpd.conf \ | 29 | file://ptpd.conf \ |
29 | " | 30 | " |