From b22b85bcdfd1fb6f8c8d73fe8054fbd89a4a84b7 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 27 May 2025 16:05:36 +1000 Subject: [PATCH] mysql_init: early alloc failure not freed Its possible for the net extensions allocation to succeed but the other extensions to fail to allocate. In this later case free the net alternatives explicitly if we where going to free the entire allocation. --- libmariadb/mariadb_lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index 32c23bda..5122166c 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -1357,7 +1357,11 @@ mysql_init(MYSQL *mysql) return mysql; error: if (mysql->free_me) + { + if (mysql->net.extension) + free(mysql->net.extension); free(mysql); + } return 0; }