Skip to content

Commit

Permalink
Merge pull request #144 from dfskoll/null-out-freed-pointers-to-avoid…
Browse files Browse the repository at this point in the history
…-potential-use-after-free

Clear out freed pointers for safety.
  • Loading branch information
9EOR9 committed Aug 30, 2020
2 parents cc40655 + 73dfd1e commit f7fa090
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libmariadb/mariadb_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2108,6 +2108,10 @@ mysql_close(MYSQL *mysql)
if (mysql->extension)
free(mysql->extension);

/* Clear pointers for better safety */
mysql->net.extension = NULL;
mysql->extension = NULL;

mysql->net.pvio= 0;
if (mysql->free_me)
free(mysql);
Expand Down

0 comments on commit f7fa090

Please sign in to comment.