From owner-svn-src-head@freebsd.org Mon Jun 3 17:29:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F9215B8485; Mon, 3 Jun 2019 17:29:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 245DC8C46D; Mon, 3 Jun 2019 17:29:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC046948E; Mon, 3 Jun 2019 17:29:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53HTvmx036235; Mon, 3 Jun 2019 17:29:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53HTvl6036234; Mon, 3 Jun 2019 17:29:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906031729.x53HTvl6036234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Jun 2019 17:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348559 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 245DC8C46D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 17:29:58 -0000 Author: mav Date: Mon Jun 3 17:29:57 2019 New Revision: 348559 URL: https://svnweb.freebsd.org/changeset/base/348559 Log: MFV r348537: 8601 memory leak in get_special_prop() illumos/illumos-gate@e19b450bec203d8be04447ea476d7a86b36d63a1 Reviewed by: Serapheim Dimitropoulos Reviewed by: Sara Hartse Reviewed by: Pavel Zakharov Reviewed by: Matt Ahrens Reviewed by: Robert Mustacchi Approved by: Dan McDonald Author: John Gallagher Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c Mon Jun 3 17:27:25 2019 (r348558) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c Mon Jun 3 17:29:57 2019 (r348559) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ #include "lua.h" @@ -431,16 +431,21 @@ get_special_prop(lua_State *state, dsl_dataset_t *ds, case ZFS_PROP_INCONSISTENT: numval = dsl_get_inconsistent(ds); break; - case ZFS_PROP_RECEIVE_RESUME_TOKEN: - VERIFY3U(strlcpy(strval, get_receive_resume_stats_impl(ds), - ZAP_MAXVALUELEN), <, ZAP_MAXVALUELEN); + case ZFS_PROP_RECEIVE_RESUME_TOKEN: { + char *token = get_receive_resume_stats_impl(ds); + VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN), <, + ZAP_MAXVALUELEN); + strfree(token); if (strcmp(strval, "") == 0) { - VERIFY3U(strlcpy(strval, get_child_receive_stats(ds), - ZAP_MAXVALUELEN), <, ZAP_MAXVALUELEN); + token = get_child_receive_stats(ds); + VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN), <, + ZAP_MAXVALUELEN); + strfree(token); if (strcmp(strval, "") == 0) error = ENOENT; } break; + } case ZFS_PROP_VOLSIZE: ASSERT(ds_type == ZFS_TYPE_VOLUME); error = dmu_objset_from_ds(ds, &os);