Commit 243a3e41 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msvcrt: Remove redundant NULL checks before MSVCRT_free.

parent 125e310e
...@@ -231,8 +231,7 @@ int CDECL _kbhit(void) ...@@ -231,8 +231,7 @@ int CDECL _kbhit(void)
break; break;
} }
} }
if (ir) MSVCRT_free(ir);
MSVCRT_free(ir);
} }
UNLOCK_CONSOLE; UNLOCK_CONSOLE;
return retval; return retval;
......
...@@ -544,8 +544,7 @@ DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_dtor); ...@@ -544,8 +544,7 @@ DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_dtor);
void __stdcall MSVCRT_type_info_dtor(type_info * _this) void __stdcall MSVCRT_type_info_dtor(type_info * _this)
{ {
TRACE("(%p)\n", _this); TRACE("(%p)\n", _this);
if (_this->name) MSVCRT_free(_this->name);
MSVCRT_free(_this->name);
} }
/****************************************************************** /******************************************************************
......
...@@ -219,8 +219,7 @@ MSVCRT__onexit_t CDECL MSVCRT__onexit(MSVCRT__onexit_t func) ...@@ -219,8 +219,7 @@ MSVCRT__onexit_t CDECL MSVCRT__onexit(MSVCRT__onexit_t func)
} }
memcpy (newtable, MSVCRT_atexit_table, MSVCRT_atexit_table_size); memcpy (newtable, MSVCRT_atexit_table, MSVCRT_atexit_table_size);
MSVCRT_atexit_table_size += 32; MSVCRT_atexit_table_size += 32;
if (MSVCRT_atexit_table) MSVCRT_free (MSVCRT_atexit_table);
MSVCRT_free (MSVCRT_atexit_table);
MSVCRT_atexit_table = newtable; MSVCRT_atexit_table = newtable;
} }
MSVCRT_atexit_table[MSVCRT_atexit_registered] = func; MSVCRT_atexit_table[MSVCRT_atexit_registered] = func;
......
...@@ -2040,11 +2040,8 @@ int CDECL MSVCRT_fclose(MSVCRT_FILE* file) ...@@ -2040,11 +2040,8 @@ int CDECL MSVCRT_fclose(MSVCRT_FILE* file)
int r, flag; int r, flag;
flag = file->_flag; flag = file->_flag;
if (file->_tmpfname) MSVCRT_free(file->_tmpfname);
{ file->_tmpfname = NULL;
MSVCRT_free(file->_tmpfname);
file->_tmpfname = NULL;
}
/* flush stdio buffers */ /* flush stdio buffers */
if(file->_flag & MSVCRT__IOWRT) if(file->_flag & MSVCRT__IOWRT)
MSVCRT_fflush(file); MSVCRT_fflush(file);
......
...@@ -371,7 +371,7 @@ MSVCRT_intptr_t CDECL _spawnle(int flags, const char* name, const char* arg0, .. ...@@ -371,7 +371,7 @@ MSVCRT_intptr_t CDECL _spawnle(int flags, const char* name, const char* arg0, ..
ret = msvcrt_spawn(flags, name, args, envs); ret = msvcrt_spawn(flags, name, args, envs);
MSVCRT_free(args); MSVCRT_free(args);
if (envs) MSVCRT_free(envs); MSVCRT_free(envs);
return ret; return ret;
} }
...@@ -427,7 +427,7 @@ MSVCRT_intptr_t CDECL _spawnlpe(int flags, const char* name, const char* arg0, . ...@@ -427,7 +427,7 @@ MSVCRT_intptr_t CDECL _spawnlpe(int flags, const char* name, const char* arg0, .
ret = msvcrt_spawn(flags, fullname[0] ? fullname : name, args, envs); ret = msvcrt_spawn(flags, fullname[0] ? fullname : name, args, envs);
MSVCRT_free(args); MSVCRT_free(args);
if (envs) MSVCRT_free(envs); MSVCRT_free(envs);
return ret; return ret;
} }
...@@ -482,8 +482,7 @@ MSVCRT_intptr_t CDECL _spawnve(int flags, const char* name, const char* const* a ...@@ -482,8 +482,7 @@ MSVCRT_intptr_t CDECL _spawnve(int flags, const char* name, const char* const* a
ret = msvcrt_spawn(flags, fullname, args, envs); ret = msvcrt_spawn(flags, fullname, args, envs);
MSVCRT_free(args); MSVCRT_free(args);
} }
if (envs) MSVCRT_free(envs);
MSVCRT_free(envs);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment