]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: pollers: remove uneeded free in global init
authorWilliam Dauchy <w.dauchy@criteo.com>
Mon, 11 May 2020 13:20:03 +0000 (15:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 May 2020 09:45:37 +0000 (11:45 +0200)
Since commit d4604adeaa8c ("MAJOR: threads/fd: Make fd stuffs
thread-safe"), we init pollers per thread using a helper. It was still
correct for mono-thread mode until commit cd7879adc2c4 ("BUG/MEDIUM:
threads: Run the poll loop on the main thread too"). We now use a deinit
helper for all threads, making those free uneeded.

Only poll and select are affected by this very minor issue.

it could be backported from v1.8 to v2.1.

Fixes: cd7879adc2c4 ("BUG/MEDIUM: threads: Run the poll loop on the main
thread too")
Signed-off-by: William Dauchy <w.dauchy@criteo.com>
src/ev_poll.c
src/ev_select.c

index 538f0705723c90cac122cf68a014ced0e2f29038..8df244566550ef4a6d42146685d0b6b2c4bf7cc9 100644 (file)
@@ -286,7 +286,6 @@ static int _do_init(struct poller *p)
  fail_swevt:
        free(fd_evts[DIR_RD]);
  fail_srevt:
-       free(poll_events);
        p->pref = 0;
        return 0;
 }
index ab021b97f78e5ee793e478d151d5d1e9c466095d..acfdbb94a295ace15ba2396fd499b23628aad87c 100644 (file)
@@ -255,7 +255,7 @@ static int _do_init(struct poller *p)
        p->private = NULL;
 
        if (global.maxsock > FD_SETSIZE)
-               goto fail_revt;
+               goto fail_srevt;
 
        fd_set_bytes = sizeof(fd_set) * (global.maxsock + FD_SETSIZE - 1) / FD_SETSIZE;
 
@@ -272,9 +272,6 @@ static int _do_init(struct poller *p)
  fail_swevt:
        free(fd_evts[DIR_RD]);
  fail_srevt:
-       free(tmp_evts[DIR_WR]);
-       free(tmp_evts[DIR_RD]);
- fail_revt:
        p->pref = 0;
        return 0;
 }