Fix CID 1491200, 1491294 and 1491301: resource leaks.
authorwwp <subscript@free.fr>
Mon, 27 Sep 2021 16:03:43 +0000 (18:03 +0200)
committerwwp <subscript@free.fr>
Mon, 27 Sep 2021 16:03:43 +0000 (18:03 +0200)
src/ssl_manager.c

index 67dc5e8513c1a70550f0229a78c4fdff9e015cb5..e8d3833c398bc9d99120acf2e8580a0456c1855e 100644 (file)
@@ -346,6 +346,7 @@ static void ssl_manager_load_certs (void)
                debug_print("couldn't open dir '%s': %s (%d)\n", path,
                                error->message, error->code);
                g_error_free(error);
+        g_free(path);
                return;
        }
        
@@ -366,11 +367,13 @@ static void ssl_manager_load_certs (void)
                                                        server, port, cert);
                                }
                        }
-               
+               }
+               if (server)
                        g_free(server);
+               if (port)
                        g_free(port);
+               if (fp)
                        g_free(fp);
-               }
                row++;
        }
        g_dir_close(dir);