Plug memory leak.

Found by:	Coverity Prevent
CID:		7051
MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2010-06-14 21:33:18 +00:00
parent 6744284aec
commit 9f31eddba0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209180

View File

@ -707,8 +707,10 @@ nv_add(struct nv *nv, const unsigned char *value, size_t vsize, int type,
assert(errno != 0);
if (nv->nv_error == 0)
nv->nv_error = errno;
free(nvh);
return;
}
free(nvh);
/* Add the actual data. */
if (ebuf_add_tail(nv->nv_ebuf, value, vsize) < 0) {
assert(errno != 0);