diff options
author | Matthew Ahrens <mahrens@delphix.com> | 2017-04-03 09:47:11 -0700 |
---|---|---|
committer | Prakash Surya <prakash.surya@delphix.com> | 2017-06-13 13:08:07 -0700 |
commit | 843c2111b160463f014d325560ad4b051711928e (patch) | |
tree | 47f8ddadb5d0800ce578fd327e9a421cd4d82872 /usr/src | |
parent | 403a8da73c64ff9dfb6230ba045c765a242213fb (diff) | |
download | illumos-joyent-843c2111b160463f014d325560ad4b051711928e.tar.gz |
8375 Kernel memory leak in nvpair code
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/common/nvpair/nvpair.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/common/nvpair/nvpair.c b/usr/src/common/nvpair/nvpair.c index ca370b1874..5881ba54b7 100644 --- a/usr/src/common/nvpair/nvpair.c +++ b/usr/src/common/nvpair/nvpair.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2015, 2016 by Delphix. All rights reserved. + * Copyright (c) 2015, 2017 by Delphix. All rights reserved. */ #include <sys/stropts.h> @@ -2195,8 +2195,10 @@ nvs_embedded(nvstream_t *nvs, nvlist_t *embedded) nvlist_init(embedded, embedded->nvl_nvflag, priv); - if (nvs->nvs_recursion >= nvpair_max_recursion) + if (nvs->nvs_recursion >= nvpair_max_recursion) { + nvlist_free(embedded); return (EINVAL); + } nvs->nvs_recursion++; if ((err = nvs_operation(nvs, embedded, NULL)) != 0) nvlist_free(embedded); |