aboutsummaryrefslogtreecommitdiffstats
path: root/uts
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2019-06-03 15:25:12 +0000
committerAlexander Motin <mav@FreeBSD.org>2019-06-03 15:25:12 +0000
commitba6517c8a44913eec725e7bb67159e9990b74030 (patch)
tree944979cc5108d96b76cb3f454046d42e86be6c19 /uts
parent740701f1c4a0d7e5baa0edab5bcc3264d0de7180 (diff)
downloadsrc-ba6517c8a44913eec725e7bb67159e9990b74030.tar.gz
src-ba6517c8a44913eec725e7bb67159e9990b74030.zip
8601 memory leak in get_special_prop()
illumos/illumos-gate@e19b450bec203d8be04447ea476d7a86b36d63a1 Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com> Reviewed by: Sara Hartse <sara.hartse@delphix.com> Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com> Author: John Gallagher <john.gallagher@delphix.com>
Notes
Notes: svn path=/vendor-sys/illumos/dist/; revision=348537
Diffstat (limited to 'uts')
-rw-r--r--uts/common/fs/zfs/zcp_get.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/uts/common/fs/zfs/zcp_get.c b/uts/common/fs/zfs/zcp_get.c
index 54e141d96772..85e00a0f93d1 100644
--- a/uts/common/fs/zfs/zcp_get.c
+++ b/uts/common/fs/zfs/zcp_get.c
@@ -14,7 +14,7 @@
*/
/*
- * Copyright (c) 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2016, 2017 by Delphix. All rights reserved.
*/
#include "lua.h"
@@ -422,16 +422,21 @@ get_special_prop(lua_State *state, dsl_dataset_t *ds, const char *dsname,
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);