diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-25 10:54:38 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-25 10:54:38 +0200 |
commit | 1c9833c511b495ed5fee16e9f769f8a458408275 (patch) | |
tree | e9c328f60f5e83babf508531267a4bc187920283 /storage/innobase/row/row0log.cc | |
parent | fa6d710b85bb5d689661ce4cd69e09d9464f397a (diff) | |
download | mariadb-git-1c9833c511b495ed5fee16e9f769f8a458408275.tar.gz |
Cleanup: row_log_free()
The nonnull attribute is not applicable to parameters that are
passed by reference, at least not in the Intel compiler.
Let us remove the reference indirection, which was only there
so that the pointer could be assigned to NULL, and let the
callers perform that task.
row_log_allocate(): Fix a bug in out-of-memory error handling
that would leave a pointer to freed memory.
Diffstat (limited to 'storage/innobase/row/row0log.cc')
-rw-r--r-- | storage/innobase/row/row0log.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 986cac54540..1a7652350a9 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -3001,7 +3001,6 @@ row_log_allocate( log->path = path; dict_index_set_online_status(index, ONLINE_INDEX_CREATION); - index->online_log = log; if (log_tmp_is_encrypted()) { ulint size = srv_sort_buf_size; @@ -3014,6 +3013,7 @@ row_log_allocate( } } + index->online_log = log; /* While we might be holding an exclusive data dictionary lock here, in row_log_abort_sec() we will not always be holding it. Use atomic operations in both cases. */ @@ -3027,7 +3027,7 @@ Free the row log for an index that was being created online. */ void row_log_free( /*=========*/ - row_log_t*& log) /*!< in,own: row log */ + row_log_t* log) /*!< in,own: row log */ { MONITOR_ATOMIC_DEC(MONITOR_ONLINE_CREATE_INDEX); @@ -3046,7 +3046,6 @@ row_log_free( mutex_free(&log->mutex); ut_free(log); - log = NULL; } /******************************************************//** |