Simplify super ugly exit path
authortb <tb@openbsd.org>
Wed, 17 Apr 2024 15:03:22 +0000 (15:03 +0000)
committertb <tb@openbsd.org>
Wed, 17 Apr 2024 15:03:22 +0000 (15:03 +0000)
ok job

usr.sbin/rpki-client/parser.c

index f6257ea..d26d9c7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parser.c,v 1.133 2024/04/17 15:00:50 job Exp $ */
+/*     $OpenBSD: parser.c,v 1.134 2024/04/17 15:03:22 tb Exp $ */
 /*
  * Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -480,12 +480,11 @@ proc_parser_mft(struct entity *entp, struct mft **mp, char **crlfile,
 
        if (*mp != NULL) {
                *crlmtime = crl->thisupdate;
-               if (!crl_insert(&crlt, crl)) {
-                       crl_free(crl);
-               }
-       } else {
-               crl_free(crl);
+               if (crl_insert(&crlt, crl))
+                       crl = NULL;
        }
+       crl_free(crl);
+
        return file;
 }