Skip to content

Commit d6b7738

Browse files
committed
Fix potential null pointer access after the allocation error
1 parent 234ae43 commit d6b7738

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

extra/mariabackup/backup_copy.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ datadir_iter_new(const char *path, bool skip_first_level = true)
196196
datadir_iter_t *it;
197197

198198
it = static_cast<datadir_iter_t *>(malloc(sizeof(datadir_iter_t)));
199+
if (!it)
200+
goto error;
199201
memset(it, 0, sizeof(datadir_iter_t));
200202

201203
pthread_mutex_init(&it->mutex, NULL);

0 commit comments

Comments
 (0)