summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2021-09-01 18:21:34 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2021-09-01 18:21:34 +0200
commitd6b7738dcce85b83282fdab6702ac0b5985666d3 (patch)
tree6161ff928dc3b0a8f164c41b279adfb7bab5ea96 /extra
parent234ae43d5afe9b9e980dd2aeaf6d1f21b74af27f (diff)
downloadmariadb-git-d6b7738dcce85b83282fdab6702ac0b5985666d3.tar.gz
Fix potential null pointer access after the allocation error
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/backup_copy.cc2
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);