mirror of
https://github.com/reactos/wine.git
synced 2025-05-13 10:56:08 +00:00
janitorial: Remove remaining NULL checks before free() (found by Smatch).
This commit is contained in:
parent
0fb444b58c
commit
173f7bd26c
@ -805,8 +805,7 @@ void chm_close(struct chmFile *h)
|
|||||||
h->cache_blocks = NULL;
|
h->cache_blocks = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (h->cache_block_indices)
|
free(h->cache_block_indices);
|
||||||
free(h->cache_block_indices);
|
|
||||||
h->cache_block_indices = NULL;
|
h->cache_block_indices = NULL;
|
||||||
|
|
||||||
free(h);
|
free(h);
|
||||||
|
@ -208,8 +208,7 @@ void LZXteardown(struct LZXstate *pState)
|
|||||||
{
|
{
|
||||||
if (pState)
|
if (pState)
|
||||||
{
|
{
|
||||||
if (pState->window)
|
free(pState->window);
|
||||||
free(pState->window);
|
|
||||||
free(pState);
|
free(pState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -384,8 +384,8 @@ static void test_fgetwc( void )
|
|||||||
}
|
}
|
||||||
ok(!(diff_found), "fgetwc difference found in BINARY mode\n");
|
ok(!(diff_found), "fgetwc difference found in BINARY mode\n");
|
||||||
ok(*wptr == '\n', "Should get newline\n");
|
ok(*wptr == '\n', "Should get newline\n");
|
||||||
|
|
||||||
if(mytextW) free (mytextW);
|
free(mytextW);
|
||||||
fclose(tempfh);
|
fclose(tempfh);
|
||||||
unlink(tempf);
|
unlink(tempf);
|
||||||
}
|
}
|
||||||
@ -481,7 +481,7 @@ static void test_file_put_get( void )
|
|||||||
diff_found |= (*aptr != *wptr);
|
diff_found |= (*aptr != *wptr);
|
||||||
}
|
}
|
||||||
ok(!(diff_found), "fgetwc doesn't strip CR in TEXT mode\n");
|
ok(!(diff_found), "fgetwc doesn't strip CR in TEXT mode\n");
|
||||||
if(mytextW) free (mytextW);
|
free(mytextW);
|
||||||
fclose(tempfh);
|
fclose(tempfh);
|
||||||
unlink(tempf);
|
unlink(tempf);
|
||||||
}
|
}
|
||||||
|
@ -231,8 +231,7 @@ FreeSavedImages(GifFileType * GifFile) {
|
|||||||
sp->ImageDesc.ColorMap = NULL;
|
sp->ImageDesc.ColorMap = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp->RasterBits)
|
free(sp->RasterBits);
|
||||||
free(sp->RasterBits);
|
|
||||||
|
|
||||||
if (sp->ExtensionBlocks)
|
if (sp->ExtensionBlocks)
|
||||||
FreeExtension(sp);
|
FreeExtension(sp);
|
||||||
@ -962,10 +961,8 @@ DGifCloseFile(GifFileType * GifFile) {
|
|||||||
GifFile->SColorMap = NULL;
|
GifFile->SColorMap = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Private) {
|
free(Private);
|
||||||
free(Private);
|
Private = NULL;
|
||||||
Private = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GifFile->SavedImages) {
|
if (GifFile->SavedImages) {
|
||||||
FreeSavedImages(GifFile);
|
FreeSavedImages(GifFile);
|
||||||
|
@ -1379,8 +1379,7 @@ buffer_resize(WINE_WAVEOUT* wwo, int len)
|
|||||||
void *oldbuf = wwo->SoundBuffer;
|
void *oldbuf = wwo->SoundBuffer;
|
||||||
memcpy(newbuf, oldbuf, wwo->BufferUsed);
|
memcpy(newbuf, oldbuf, wwo->BufferUsed);
|
||||||
wwo->SoundBuffer = newbuf;
|
wwo->SoundBuffer = newbuf;
|
||||||
if (oldbuf != NULL)
|
free(oldbuf);
|
||||||
free(oldbuf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nas_add_buffer(WINE_WAVEOUT* wwo) {
|
static int nas_add_buffer(WINE_WAVEOUT* wwo) {
|
||||||
|
@ -1249,11 +1249,10 @@ static bufferstackentry_t *pop_buffer(void)
|
|||||||
if(pp_status.debug)
|
if(pp_status.debug)
|
||||||
fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", pp_status.input, pp_status.line_number, pp_incl_state.ppp, iep->filename);
|
fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", pp_status.input, pp_status.line_number, pp_incl_state.ppp, iep->filename);
|
||||||
}
|
}
|
||||||
else if(bufferstack[bufferstackidx].include_filename)
|
else
|
||||||
free(bufferstack[bufferstackidx].include_filename);
|
free(bufferstack[bufferstackidx].include_filename);
|
||||||
}
|
}
|
||||||
if(pp_incl_state.ppp)
|
free(pp_incl_state.ppp);
|
||||||
free(pp_incl_state.ppp);
|
|
||||||
pp_incl_state = bufferstack[bufferstackidx].incl;
|
pp_incl_state = bufferstack[bufferstackidx].incl;
|
||||||
pass_data = bufferstack[bufferstackidx].pass_data;
|
pass_data = bufferstack[bufferstackidx].pass_data;
|
||||||
|
|
||||||
@ -1320,12 +1319,9 @@ static void free_macro(macexpstackentry_t *mep)
|
|||||||
|
|
||||||
for(i = 0; i < mep->nargs; i++)
|
for(i = 0; i < mep->nargs; i++)
|
||||||
free(mep->args[i]);
|
free(mep->args[i]);
|
||||||
if(mep->args)
|
free(mep->args);
|
||||||
free(mep->args);
|
free(mep->nnls);
|
||||||
if(mep->nnls)
|
free(mep->curarg);
|
||||||
free(mep->nnls);
|
|
||||||
if(mep->curarg)
|
|
||||||
free(mep->curarg);
|
|
||||||
free(mep);
|
free(mep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ void wpp_add_define( const char *name, const char *value )
|
|||||||
{
|
{
|
||||||
if (!strcmp( def->name, name ))
|
if (!strcmp( def->name, name ))
|
||||||
{
|
{
|
||||||
if (def->value) free( def->value );
|
free( def->value );
|
||||||
def->value = pp_xstrdup(value);
|
def->value = pp_xstrdup(value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ void wpp_del_define( const char *name )
|
|||||||
{
|
{
|
||||||
if (!strcmp( def->name, name ))
|
if (!strcmp( def->name, name ))
|
||||||
{
|
{
|
||||||
if (def->value) free( def->value );
|
free( def->value );
|
||||||
def->value = NULL;
|
def->value = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -178,9 +178,7 @@ void PerfDataRefresh(void)
|
|||||||
/*
|
/*
|
||||||
* Save system processor time info
|
* Save system processor time info
|
||||||
*/
|
*/
|
||||||
if (SystemProcessorTimeInfo) {
|
free(SystemProcessorTimeInfo);
|
||||||
free(SystemProcessorTimeInfo);
|
|
||||||
}
|
|
||||||
SystemProcessorTimeInfo = SysProcessorTimeInfo;
|
SystemProcessorTimeInfo = SysProcessorTimeInfo;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -231,9 +229,7 @@ void PerfDataRefresh(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now alloc a new PERFDATA array and fill in the data */
|
/* Now alloc a new PERFDATA array and fill in the data */
|
||||||
if (pPerfDataOld) {
|
free(pPerfDataOld);
|
||||||
free(pPerfDataOld);
|
|
||||||
}
|
|
||||||
pPerfDataOld = pPerfData;
|
pPerfDataOld = pPerfData;
|
||||||
pPerfData = (PPERFDATA)malloc(sizeof(PERFDATA) * ProcessCount);
|
pPerfData = (PPERFDATA)malloc(sizeof(PERFDATA) * ProcessCount);
|
||||||
pSPI = (PSYSTEM_PROCESS_INFORMATION)pBuffer;
|
pSPI = (PSYSTEM_PROCESS_INFORMATION)pBuffer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user