From: Michael Tremer Date: Wed, 21 Oct 2020 09:28:39 +0000 (+0000) Subject: writer: Free array with pointer to ASes, too X-Git-Tag: 0.9.5~112 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d226ad2d97cbcd42ce807d9308569b1b9c5d4e2f;p=location%2Flibloc.git writer: Free array with pointer to ASes, too Signed-off-by: Michael Tremer --- diff --git a/src/writer.c b/src/writer.c index 5939cff..160650f 100644 --- a/src/writer.c +++ b/src/writer.c @@ -147,8 +147,11 @@ static void loc_writer_free(struct loc_writer* writer) { EVP_PKEY_free(writer->private_key2); // Unref all AS - for (unsigned int i = 0; i < writer->as_count; i++) { - loc_as_unref(writer->as[i]); + if (writer->as) { + for (unsigned int i = 0; i < writer->as_count; i++) { + loc_as_unref(writer->as[i]); + } + free(writer->as); } // Release network tree