diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2021-09-01 18:21:34 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2021-09-01 18:21:34 +0200 |
commit | d6b7738dcce85b83282fdab6702ac0b5985666d3 (patch) | |
tree | 6161ff928dc3b0a8f164c41b279adfb7bab5ea96 /extra | |
parent | 234ae43d5afe9b9e980dd2aeaf6d1f21b74af27f (diff) | |
download | mariadb-git-d6b7738dcce85b83282fdab6702ac0b5985666d3.tar.gz |
Fix potential null pointer access after the allocation error
Diffstat (limited to 'extra')
-rw-r--r-- | extra/mariabackup/backup_copy.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 5637ec3d4d7..c46c32213d6 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -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); |