Skip to content

Commit

Permalink
Fix leak in run_plugin_auth_nonblocking
Browse files Browse the repository at this point in the history
Summary:
This fixes this leak:

```
Direct leak of 74 byte(s) in 2 object(s) allocated from:
    #0 0x9f235f in malloc
    #1 0xd88f47 in my_raw_malloc(unsigned long, int)
    #2 0xd88e1e in my_malloc(unsigned int, unsigned long, int)
    #3 0xc183e4 in read_ok_ex
    #4 0xc479d5 in authsm_handle_second_authenticate_user(mysql_async_auth*)
    #5 0xc32a97 in run_plugin_auth_nonblocking(MYSQL*, char*, unsigned int, char const*, char const*, char const*, char const*, bool)
    #6 0xc3329a in run_plugin_auth_nonblocking_wrapper
    #7 0xbfd0de in mysql_change_user_nonblocking
    #8 0xb7f162 in async_mysql_change_user_wrapper(MYSQL*, char const*, char const*, char const*)
    #9 0xb7eff1 in mysql_change_user_wrapper(MYSQL*, char const*, char const*, char const*)
    #10 0xb63882 in do_change_user(st_command*)
    #11 0xb5ad99 in main
    #12 0x7fbe8362c656 in __libc_start_call_main
    #13 0x7fbe8362c717 in __libc_start_main_impl
    #14 0x94b160 in _start
```

Squash with: D29434855

Reviewed By: jupyung

Differential Revision: D43006844

fbshipit-source-id: 254272b
  • Loading branch information
Manuel Ung authored and facebook-github-bot committed Feb 3, 2023
1 parent 392f9b9 commit e428b37
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sql-common/client.cc
Expand Up @@ -5951,6 +5951,7 @@ mysql_state_machine_status run_plugin_auth_nonblocking(
my_free(ctx->saved_db);

// alloc new connect information
my_free(mysql->db);
mysql->db = db ? my_strdup(PSI_NOT_INSTRUMENTED, db, MYF(MY_WME)) : 0;
} else { // STATE_MACHINE_FAILED
// free temporary connect information
Expand Down

0 comments on commit e428b37

Please sign in to comment.