diff options
author | iggy@recycle.(none) <> | 2007-03-20 10:34:25 -0400 |
---|---|---|
committer | iggy@recycle.(none) <> | 2007-03-20 10:34:25 -0400 |
commit | 988ce580526ab3886f25cae381858855348b2d70 (patch) | |
tree | 93d9aa9aaeb15926dff991fab145f7461d04b631 /mysys/mf_tempdir.c | |
parent | 9a5f0bff4f73bc2197465ba958f2e77927b29ae2 (diff) | |
download | mariadb-git-988ce580526ab3886f25cae381858855348b2d70.tar.gz |
Bug#23736 Pointer free error in mysqlbinlog
- Mis-matched SAFEMALLOC defines caused misleading error message.
Diffstat (limited to 'mysys/mf_tempdir.c')
-rw-r--r-- | mysys/mf_tempdir.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c index c24e2a0101b..bcd003920f1 100644 --- a/mysys/mf_tempdir.c +++ b/mysys/mf_tempdir.c @@ -26,9 +26,8 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) { char *end, *copy; char buff[FN_REFLEN]; - DYNAMIC_ARRAY t_arr; pthread_mutex_init(&tmpdir->mutex, MY_MUTEX_INIT_FAST); - if (my_init_dynamic_array(&t_arr, sizeof(char*), 1, 5)) + if (my_init_dynamic_array(&tmpdir->full_list, sizeof(char*), 1, 5)) return TRUE; if (!pathlist || !pathlist[0]) { @@ -49,14 +48,14 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) convert_dirname(buff, pathlist, end); if (!(copy=my_strdup(buff, MYF(MY_WME)))) return TRUE; - if (insert_dynamic(&t_arr, (gptr)©)) + if (insert_dynamic(&tmpdir->full_list, (gptr)©)) return TRUE; pathlist=end+1; } while (*end); - freeze_size(&t_arr); - tmpdir->list=(char **)t_arr.buffer; - tmpdir->max=t_arr.elements-1; + freeze_size(&tmpdir->full_list); + tmpdir->list=(char **)tmpdir->full_list.buffer; + tmpdir->max=tmpdir->full_list.elements-1; tmpdir->cur=0; return FALSE; } @@ -76,7 +75,7 @@ void free_tmpdir(MY_TMPDIR *tmpdir) uint i; for (i=0; i<=tmpdir->max; i++) my_free(tmpdir->list[i], MYF(0)); - my_free((gptr)tmpdir->list, MYF(0)); + delete_dynamic(&tmpdir->full_list); pthread_mutex_destroy(&tmpdir->mutex); } |