]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
daemon: Properly clean up logger entries in error cases
authorTobias Brunner <tobias@strongswan.org>
Tue, 4 Mar 2025 13:33:36 +0000 (14:33 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 4 Mar 2025 13:33:36 +0000 (14:33 +0100)
The copied target string was not freed.

src/libcharon/daemon.c

index 8af6056c9d852e7a585f204f34f19be0b25457a5..05819696ccbbea3d71c48dbb2d8ef9e5c572d7ca 100644 (file)
@@ -368,7 +368,7 @@ static logger_entry_t *get_logger_entry(char *target, logger_type_t type,
                                                                                                get_syslog_facility(target));
                                break;
 #else
-                               free(entry);
+                               logger_entry_destroy(entry);
                                return NULL;
 #endif /* HAVE_SYSLOG */
                        case CUSTOM_LOGGER:
@@ -378,7 +378,7 @@ static logger_entry_t *get_logger_entry(char *target, logger_type_t type,
                                }
                                if (!entry->logger.custom)
                                {
-                                       free(entry);
+                                       logger_entry_destroy(entry);
                                        return NULL;
                                }
                                break;