Free the parser then close the file. Seems like the better order.
authorclaudio <claudio@openbsd.org>
Wed, 7 Apr 2021 16:29:14 +0000 (16:29 +0000)
committerclaudio <claudio@openbsd.org>
Wed, 7 Apr 2021 16:29:14 +0000 (16:29 +0000)
usr.sbin/rpki-client/rrdp.c

index 2f43f75..4464e50 100644 (file)
@@ -1,4 +1,4 @@
-/*      $OpenBSD: rrdp.c,v 1.2 2021/04/06 18:35:46 claudio Exp $ */
+/*      $OpenBSD: rrdp.c,v 1.3 2021/04/07 16:29:14 claudio Exp $ */
 /*
  * Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
  * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
@@ -230,10 +230,10 @@ rrdp_free(struct rrdp *s)
        free_snapshot_xml(s->sxml);
        free_delta_xml(s->dxml);
 
-       if (s->infd != -1)
-               close(s->infd);
        if (s->parser)
                XML_ParserFree(s->parser);
+       if (s->infd != -1)
+               close(s->infd);
        free(s->notifyuri);
        free(s->local);
        free(s->last_mod);