mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Fix potential null pointer access after the allocation error
This commit is contained in:
parent
234ae43d5a
commit
d6b7738dcc
1 changed files with 2 additions and 0 deletions
|
@ -196,6 +196,8 @@ datadir_iter_new(const char *path, bool skip_first_level = true)
|
|||
datadir_iter_t *it;
|
||||
|
||||
it = static_cast<datadir_iter_t *>(malloc(sizeof(datadir_iter_t)));
|
||||
if (!it)
|
||||
goto error;
|
||||
memset(it, 0, sizeof(datadir_iter_t));
|
||||
|
||||
pthread_mutex_init(&it->mutex, NULL);
|
||||
|
|
Loading…
Reference in a new issue