Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jan 2017 09:01:09 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r312052 - stable/10/contrib/bsnmp/lib
Message-ID:  <201701130901.v0D9196V062078@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri Jan 13 09:01:09 2017
New Revision: 312052
URL: https://svnweb.freebsd.org/changeset/base/312052

Log:
  MFC r311390:
  
  snmp_table_fetch_async: don't leak `work` if snmp_pdu_send(..) fails
  
  CID:		1017276

Modified:
  stable/10/contrib/bsnmp/lib/snmpclient.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bsnmp/lib/snmpclient.c
==============================================================================
--- stable/10/contrib/bsnmp/lib/snmpclient.c	Fri Jan 13 09:01:06 2017	(r312051)
+++ stable/10/contrib/bsnmp/lib/snmpclient.c	Fri Jan 13 09:01:09 2017	(r312052)
@@ -728,8 +728,11 @@ snmp_table_fetch_async(const struct snmp
 	work->last_change = 0;
 	table_init_pdu(descr, &work->pdu);
 
-	if (snmp_pdu_send(&work->pdu, table_cb, work) == -1)
+	if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) {
+		free(work);
+		work = NULL;
 		return (-1);
+	}
 	return (0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701130901.v0D9196V062078>