Stop the options string leak if it is not attached into the options

linked list.

Obtained from:	OpenBSD
This commit is contained in:
kevlo 2014-01-26 07:20:32 +00:00
parent 741e52a6b9
commit c90ebc9699

View File

@ -1385,6 +1385,7 @@ opt_add(const char *str)
free(lstr);
return(-1);
}
lstr = NULL; /* parts of string going onto the OPLIST */
*pt++ = '\0';
opt->name = frpt;
opt->value = pt;
@ -1400,6 +1401,7 @@ opt_add(const char *str)
optail->fow = opt;
optail = opt;
}
free(lstr);
return(0);
}