Fix memory leak in the nvlist string array.

Submitted by:	Adam Starak <starak.adam@gmail.com>
MFC after:	1 week
This commit is contained in:
oshogbo 2016-07-17 15:29:31 +00:00
parent 3815c80a2e
commit 9043c75aa1

View File

@ -1945,6 +1945,7 @@ nvpair_free(nvpair_t *nvp)
case NV_TYPE_STRING_ARRAY: case NV_TYPE_STRING_ARRAY:
for (i = 0; i < nvp->nvp_nitems; i++) for (i = 0; i < nvp->nvp_nitems; i++)
nv_free(((char **)(intptr_t)nvp->nvp_data)[i]); nv_free(((char **)(intptr_t)nvp->nvp_data)[i]);
nv_free((char **)(intptr_t)nvp->nvp_data);
break; break;
} }
nv_free(nvp); nv_free(nvp);