Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2018 23:45:01 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r331386 - stable/11/cddl/contrib/opensolaris/cmd/zdb
Message-ID:  <201803222345.w2MNj1i6094910@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Mar 22 23:45:01 2018
New Revision: 331386
URL: https://svnweb.freebsd.org/changeset/base/331386

Log:
  MFC r329657 (by asomers): Fix memory leaks in zdb introduced by r329508
  
  Reported by:    Coverity
  CID:            1386185

Modified:
  stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Thu Mar 22 23:43:48 2018	(r331385)
+++ stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Thu Mar 22 23:45:01 2018	(r331386)
@@ -3570,6 +3570,7 @@ zdb_read_block(char *thing, spa_t *spa)
 		s = "offset must be a multiple of sector size";
 	if (s) {
 		(void) printf("Invalid block specifier: %s  - %s\n", thing, s);
+		free(flagstr);
 		free(dup);
 		return;
 	}
@@ -3595,6 +3596,7 @@ zdb_read_block(char *thing, spa_t *spa)
 				blkptr_offset = strtoull(p, &p, 16);
 			if (*p != ':' && *p != '\0') {
 				(void) printf("***Invalid flag arg: '%s'\n", s);
+				free(flagstr);
 				free(dup);
 				return;
 			}



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