Date: Tue, 6 Jun 2017 21:51:04 +0000 (UTC) From: "Stephen J. Kiernan" <stevek@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319638 - head/usr.sbin/ppp Message-ID: <201706062151.v56Lp4qP020802@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: stevek Date: Tue Jun 6 21:51:04 2017 New Revision: 319638 URL: https://svnweb.freebsd.org/changeset/base/319638 Log: Before returning because of an memory allocation error, free the memory already allocated to buf. Found using clang's static analyzer - scan-build Submitted by: Thomas Rix <trix@juniper.net> Reviewed by: stevek Approved by: sjg (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9852 Modified: head/usr.sbin/ppp/iface.c Modified: head/usr.sbin/ppp/iface.c ============================================================================== --- head/usr.sbin/ppp/iface.c Tue Jun 6 21:50:00 2017 (r319637) +++ head/usr.sbin/ppp/iface.c Tue Jun 6 21:51:04 2017 (r319638) @@ -145,6 +145,7 @@ iface_Create(const char *name) iface = (struct iface *)malloc(sizeof *iface); if (iface == NULL) { fprintf(stderr, "iface_Create: malloc: %s\n", strerror(errno)); + free(buf); return NULL; } iface->name = strdup(name);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706062151.v56Lp4qP020802>