]> git.baikalelectronics.ru Git - arm-tf.git/commit
Free X509_EXTENSIONs
authorJimmy Brisson <jimmy.brisson@arm.com>
Fri, 24 Jul 2020 19:31:48 +0000 (14:31 -0500)
committerManish Pandey <manish.pandey2@arm.com>
Tue, 20 Oct 2020 20:17:25 +0000 (20:17 +0000)
commitbea8019826f97546e18265d3d7b8e54dfa7da250
tree3c3fa6098aca4c7ffe6eab75ef0d93ba71043845
parent32269499cc5f66564a2ea420a33e369373c2de0c
Free X509_EXTENSIONs

Previously, we would leak these extensions as they are not freed by the
stack. An except from the `sk_TYPE_free` documentation:

    sk_TYPE_free() frees up the sk structure. It does not free up any
    elements of sk. After this call sk is no longer valid.

The fix is to drain the stack and free its elements before freeing the
stack. sk_TYPE_pop_free does this, so we use that instead.

Change-Id: Ie70c302f9dda5af1a7243f163d36e99916ee639c
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
tools/cert_create/src/main.c