@@ -820,7 +820,6 @@ my_bool _mariadb_set_conf_option(MYSQL *mysql, const char *config_option, const
820820 switch (mariadb_defaults [i ].type ) {
821821 case MARIADB_OPTION_FUNC :
822822 return mariadb_defaults [i ].u .option_func (mysql , config_option , config_value , -1 );
823- break ;
824823 case MARIADB_OPTION_BOOL :
825824 val_bool = 0 ;
826825 if (config_value )
@@ -939,7 +938,6 @@ static int parse_connection_string(MYSQL *mysql, const char *unused __attribute_
939938 if (pos <= end )
940939 val = pos ;
941940 continue ;
942- break ;
943941 case ';' :
944942 if (in_curly_brace )
945943 {
@@ -953,7 +951,6 @@ static int parse_connection_string(MYSQL *mysql, const char *unused __attribute_
953951 _mariadb_set_conf_option (mysql , key , val );
954952 key = val = NULL ;
955953 continue ;
956- break ;
957954 }
958955 if (!key && * pos )
959956 key = pos ;
@@ -1367,7 +1364,11 @@ mysql_init(MYSQL *mysql)
13671364 return mysql ;
13681365error :
13691366 if (mysql -> free_me )
1367+ {
1368+ if (mysql -> net .extension )
1369+ free (mysql -> net .extension );
13701370 free (mysql );
1371+ }
13711372 return 0 ;
13721373}
13731374
@@ -2122,7 +2123,14 @@ my_bool STDCALL mariadb_reconnect(MYSQL *mysql)
21222123 return (1 );
21232124 }
21242125
2125- mysql_init (& tmp_mysql );
2126+ if (!mysql_init (& tmp_mysql ))
2127+ {
2128+ /* extensions may have failed to allocate */
2129+ SET_CLIENT_ERROR (mysql , CR_OUT_OF_MEMORY , SQLSTATE_UNKNOWN , 0 );
2130+ tmp_mysql .free_me = 0 ;
2131+ mysql_close (& tmp_mysql );
2132+ return (1 );
2133+ }
21262134 tmp_mysql .free_me = 0 ;
21272135 tmp_mysql .options = mysql -> options ;
21282136 if (mysql -> extension -> conn_hdlr )
0 commit comments