Plug memory leak in ntpd(8)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Plug memory leak in ntpd(8)

Michael McConville-2
Found with the Clang static analyzer.


Index: constraint.c
===================================================================
RCS file: /cvs/src/usr.sbin/ntpd/constraint.c,v
retrieving revision 1.14
diff -u -p -r1.14 constraint.c
--- constraint.c 18 Jul 2015 21:50:47 -0000 1.14
+++ constraint.c 9 Sep 2015 14:39:36 -0000
@@ -768,6 +768,7 @@ tls_readline(struct tls *tls, size_t *le
 
  if (maxlength != NULL && (*maxlength)-- == 0) {
  log_warnx("maximum length exceeded");
+ free(buf);
  return (NULL);
  }
 

Reply | Threaded
Open this post in threaded view
|

Re: Plug memory leak in ntpd(8)

Todd C. Miller
On Wed, 09 Sep 2015 10:41:07 -0400, Michael McConville wrote:

> Found with the Clang static analyzer.

Committed, thanks.

 - todd