diff options
author | Ignacio Galarza <iggy@mysql.com> | 2009-03-19 09:59:10 -0400 |
---|---|---|
committer | Ignacio Galarza <iggy@mysql.com> | 2009-03-19 09:59:10 -0400 |
commit | 868db2f21d1e1c3027ea57a8f97e893a3c7dde55 (patch) | |
tree | 4e5ec71d74af95171c31a8486be11044c6315bd3 /mysys | |
parent | 1aefa8029f5828c67fa663122a36e81647c6b8e6 (diff) | |
parent | 3525893a8da44d4ea3875d2a5b9f64e36968da3f (diff) | |
download | mariadb-git-868db2f21d1e1c3027ea57a8f97e893a3c7dde55.tar.gz |
auto-merge
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_error.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mysys/my_error.c b/mysys/my_error.c index 07656dda979..2cf704d0089 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -252,11 +252,16 @@ const char **my_error_unregister(int first, int last) void my_error_unregister_all(void) { - struct my_err_head *list, *next; - for (list= my_errmsgs_globerrs.meh_next; list; list= next) + struct my_err_head *cursor, *saved_next; + + for (cursor= my_errmsgs_globerrs.meh_next; cursor != NULL; cursor= saved_next) { - next= list->meh_next; - my_free((uchar*) list, MYF(0)); + /* We need this ptr, but we're about to free its container, so save it. */ + saved_next= cursor->meh_next; + + my_free((uchar*) cursor, MYF(0)); } + my_errmsgs_globerrs.meh_next= NULL; /* Freed in first iteration above. */ + my_errmsgs_list= &my_errmsgs_globerrs; } |