summaryrefslogtreecommitdiff
path: root/extra/mariabackup/ds_xbstream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'extra/mariabackup/ds_xbstream.cc')
-rw-r--r--extra/mariabackup/ds_xbstream.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/extra/mariabackup/ds_xbstream.cc b/extra/mariabackup/ds_xbstream.cc
index daf1cc73038..d527b6751ba 100644
--- a/extra/mariabackup/ds_xbstream.cc
+++ b/extra/mariabackup/ds_xbstream.cc
@@ -126,15 +126,19 @@ xbstream_open(ds_ctxt_t *ctxt, const char *path, MY_STAT *mystat)
pthread_mutex_lock(&stream_ctxt->mutex);
if (stream_ctxt->dest_file == NULL) {
stream_ctxt->dest_file = ds_open(dest_ctxt, path, mystat);
- if (stream_ctxt->dest_file == NULL) {
- return NULL;
- }
}
pthread_mutex_unlock(&stream_ctxt->mutex);
+ if (stream_ctxt->dest_file == NULL) {
+ return NULL;
+ }
file = (ds_file_t *) my_malloc(sizeof(ds_file_t) +
sizeof(ds_stream_file_t),
MYF(MY_FAE));
+ if (!file) {
+ msg("my_malloc() failed.");
+ goto err;
+ }
stream_file = (ds_stream_file_t *) (file + 1);
xbstream = stream_ctxt->xbstream;