Skip to content

Commit

Permalink
Fix a memory leak in |NCONF_free|.
Browse files Browse the repository at this point in the history
As I read it:

1. |_LHASH| contains
2.   buckets of |LHASH_ITEMS|, which contain
3.     |CONF_VALUE|s, which contain
4.       various bits of data.

The previous code was freeing #1 and #2 in |lh_free|, and #4 in
|value_free_contents|, but was failing to free the |CONF_VALUE|s
themselves.  The fix is to call |value_free| rather than
|value_free_contents|.

Change-Id: I1d5b48692ca9ac04df688e45d7fc113dc5cd6ddf
Reviewed-on: https://boringssl-review.googlesource.com/5742
Reviewed-by: Adam Langley <[email protected]>
  • Loading branch information
Matt Braithwaite authored and agl committed Aug 24, 2015
1 parent 685402f commit 50485c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/conf/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void NCONF_free(CONF *conf) {
return;
}

lh_CONF_VALUE_doall(conf->data, value_free_contents);
lh_CONF_VALUE_doall(conf->data, value_free);
lh_CONF_VALUE_free(conf->data);
OPENSSL_free(conf);
}
Expand Down

0 comments on commit 50485c7

Please sign in to comment.