Browse Source

Fix memory leak in error path when max length exceeded.

From Michael McConville
OPENBSD_5_9
millert 9 years ago
parent
commit
3020bb1487
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/usr.sbin/ntpd/constraint.c

+ 2
- 1
src/usr.sbin/ntpd/constraint.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: constraint.c,v 1.14 2015/07/18 21:50:47 bluhm Exp $ */
/* $OpenBSD: constraint.c,v 1.15 2015/09/09 15:05:58 millert Exp $ */
/* /*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@ -768,6 +768,7 @@ tls_readline(struct tls *tls, size_t *lenp, size_t *maxlength,
if (maxlength != NULL && (*maxlength)-- == 0) { if (maxlength != NULL && (*maxlength)-- == 0) {
log_warnx("maximum length exceeded"); log_warnx("maximum length exceeded");
free(buf);
return (NULL); return (NULL);
} }


Loading…
Cancel
Save