Fix memory leak.
authorMasaya Kawamoto <kawamoto@sraoss.co.jp>
Wed, 14 Sep 2022 00:15:26 +0000 (00:15 +0000)
committerMasaya Kawamoto <kawamoto@sraoss.co.jp>
Wed, 14 Sep 2022 00:15:26 +0000 (00:15 +0000)
This was added in the previous commit a94451901c9be0627c5e9db04e05ef2d6835dcd7

src/main/pgpool_main.c

index e4e5a9ea99ead3e17123c3a0550e30e4c749a983..a70aadfcc1f630ca32a014ef54227bc183616138 100644 (file)
@@ -464,11 +464,6 @@ PgpoolMain(bool discard_status, bool clear_memcache_oidmaps)
                on_proc_exit(FileUnlink, (Datum) un_addrs[i].sun_path);
        }
 
-       fds = malloc(sizeof(int) * (num_unix_fds + 1));
-       if (fds == NULL)
-               ereport(FATAL,
-                          (errmsg("failed to allocate memory in startup process")));
-
        /* copy unix domain sockets */
        memcpy(fds, unix_fds, sizeof(int) * num_unix_fds);
        fds[num_unix_fds] = -1;