diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-10-02 00:12:27 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-10-02 00:12:27 +0400 |
commit | d72c594739467160fb30685483c41f0f747925db (patch) | |
tree | 2118d6c50022f3510872d297e53f610abd13855f /dbug/dbug.c | |
parent | e33e27a6643e426a6143cf725a480ecd5a22899e (diff) | |
parent | 00677a802beb48e1763eaf8874390bf335ccb43e (diff) | |
download | mariadb-git-d72c594739467160fb30685483c41f0f747925db.tar.gz |
Manual merge from mysql-5.1-bugteam into mysql-5.5-bugteam.
conflicts:
conflict dbug/dbug.c
conflict sql/sql_load.cc
Diffstat (limited to 'dbug/dbug.c')
-rw-r--r-- | dbug/dbug.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c index 5029bbb8d61..040ee9356c1 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -496,6 +496,7 @@ int DbugParse(CODE_STATE *cs, const char *control) rel= control[0] == '+' || control[0] == '-'; if ((!rel || (!stack->out_file && !stack->next))) { + /* Free memory associated with the state before resetting its members */ FreeState(cs, stack, 0); stack->flags= 0; stack->delay= 0; @@ -1608,7 +1609,7 @@ static void PushState(CODE_STATE *cs) struct settings *new_malloc; new_malloc= (struct settings *) DbugMalloc(sizeof(struct settings)); - bzero(new_malloc, sizeof(*new_malloc)); + bzero(new_malloc, sizeof(struct settings)); new_malloc->next= cs->stack; cs->stack= new_malloc; } @@ -2088,7 +2089,7 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name) static void DBUGCloseFile(CODE_STATE *cs, FILE *fp) { - if (fp && fp != stderr && fp != stdout && fclose(fp) == EOF) + if (fp != NULL && fp != stderr && fp != stdout && fclose(fp) == EOF) { pthread_mutex_lock(&THR_LOCK_dbug); (void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process); |