]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: server: memory leak in _srv_update_status_op() on server DOWN
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 15 May 2023 16:03:35 +0000 (18:03 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 May 2023 07:21:01 +0000 (09:21 +0200)
When server is transitionning from UP to DOWN, a log message is generated.
e.g.: "Server backend_name/server_name is DOWN")

However since f71e064 ("MEDIUM: server: split srv_update_status() in two
functions"), the allocated buffer tmptrash which is used to prepare the
log message is not freed after it has been used, resulting in a small
memory leak each time a server goes DOWN because of an operational
change.

This is a 2.8 specific bug, no backport needed unless the above commit
gets backported.

src/server.c

index 956b78b3a897912be74a4d72fc3f4a144ef6b0bc..a6e6b39d69e211103b3c8d7fc3621a1396d0b7be 100644 (file)
@@ -5387,6 +5387,7 @@ static int _srv_update_status_op(struct server *s, enum srv_op_st_chg_cause caus
                                 tmptrash->area);
                        send_email_alert(s, log_level, "%s",
                                         tmptrash->area);
+                       free_trash_chunk(tmptrash);
                }
        }
        else if ((s->cur_state != SRV_ST_STOPPING) && (s->next_state == SRV_ST_STOPPING)) {