projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4a0fdd
)
ntpd: plug potential leak on error
author
Pavel Rochnyack
<pavel2000@ngs.ru>
Sun, 14 Oct 2018 08:45:56 +0000
(15:45 +0700)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Sun, 14 Oct 2018 08:45:56 +0000
(15:45 +0700)
Issue: #2942
src/ntpd.c
patch
|
blob
|
history
diff --git
a/src/ntpd.c
b/src/ntpd.c
index
9b4ba60
..
205403d
100644
(file)
--- a/
src/ntpd.c
+++ b/
src/ntpd.c
@@
-873,11
+873,13
@@
static int ntpd_read(void) {
ERROR(
"ntpd plugin: ntpd_do_query (REQ_PEER_LIST_SUM) failed with status %i",
status);
+ free(ps);
return status;
} else if ((ps == NULL) || (ps_num == 0) || (ps_size == 0)) {
ERROR("ntpd plugin: ntpd_do_query returned unexpected data. "
"(ps = %p; ps_num = %i; ps_size = %i)",
(void *)ps, ps_num, ps_size);
+ free(ps);
return -1;
}