Skip to content
Permalink
Browse files
Make free_opt(NULL) work like free(NULL)
Coverity spotted such a call in the error path of parse_select_node()
in the Juniper auth code, after allocating 'opt' fails.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
dwmw2 committed Oct 9, 2019
1 parent a357dfc commit 33260f4429fe84a3b1796816ee95d81864563092
Showing with 3 additions and 0 deletions.
  1. +3 −0 auth-common.c
@@ -138,6 +138,9 @@ void free_pass(char **p)

void free_opt(struct oc_form_opt *opt)
{
if (!opt)
return;

/* for SELECT options, opt->value is a pointer to oc_choice->name */
if (opt->type != OC_FORM_OPT_SELECT) {
free_pass(&opt->_value);

0 comments on commit 33260f4

Please sign in to comment.