mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 20:10:14 +01:00
Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic
patch:
// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it
@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
- free(E);
(
- E = NULL;
|
- E = 0;
)
...
- }
@@
expression E;
type T;
@@
+ free ((T) E);
+ E = NULL;
- if (unlikely (E != NULL)) {
- free((T) E);
(
- E = NULL;
|
- E = 0;
)
...
- }
@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
- free (E);
- }
@@
expression E;
type T;
@@
+ free ((T) E);
- if (unlikely (E != NULL)) {
- free ((T) E);
- }
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
a9e8054fff
commit
5067506ea6
46 changed files with 88 additions and 184 deletions
|
|
@ -611,7 +611,6 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
close(dri2_dpy->fd);
|
||||
if (dri2_dpy->driver)
|
||||
dlclose(dri2_dpy->driver);
|
||||
if (dri2_dpy->device_name)
|
||||
free(dri2_dpy->device_name);
|
||||
|
||||
if (disp->PlatformDisplay == NULL) {
|
||||
|
|
|
|||
|
|
@ -581,7 +581,6 @@ dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
|
|||
if (authenticate == NULL || !authenticate->authenticated)
|
||||
ret = -1;
|
||||
|
||||
if (authenticate)
|
||||
free(authenticate);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -655,9 +655,7 @@ GLX_eglTerminate(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
_eglReleaseDisplayResources(drv, disp);
|
||||
_eglCleanupDisplay(disp);
|
||||
|
||||
if (GLX_dpy->visuals)
|
||||
free(GLX_dpy->visuals);
|
||||
if (GLX_dpy->fbconfigs)
|
||||
free(GLX_dpy->fbconfigs);
|
||||
|
||||
if (!disp->PlatformDisplay)
|
||||
|
|
|
|||
|
|
@ -4997,10 +4997,8 @@ static void fc_pushlevel(struct r600_shader_ctx *ctx, int type)
|
|||
static void fc_poplevel(struct r600_shader_ctx *ctx)
|
||||
{
|
||||
struct r600_cf_stack_entry *sp = &ctx->bc->fc_stack[ctx->bc->fc_sp];
|
||||
if (sp->mid) {
|
||||
free(sp->mid);
|
||||
sp->mid = NULL;
|
||||
}
|
||||
sp->num_mid = 0;
|
||||
sp->start = NULL;
|
||||
sp->type = 0;
|
||||
|
|
|
|||
|
|
@ -217,9 +217,7 @@ __glXFreeDisplayPrivate(XExtData * extension)
|
|||
|
||||
priv = (__GLXdisplayPrivate *) extension->private_data;
|
||||
FreeScreenConfigs(priv);
|
||||
if (priv->serverGLXversion)
|
||||
free((char *) priv->serverGLXversion);
|
||||
|
||||
free((char *) priv);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,9 +95,7 @@ x11_screen_destroy(struct x11_screen *xscr)
|
|||
{
|
||||
if (xscr->dri_fd >= 0)
|
||||
close(xscr->dri_fd);
|
||||
if (xscr->dri_driver)
|
||||
free(xscr->dri_driver);
|
||||
if (xscr->dri_device)
|
||||
free(xscr->dri_device);
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
|
|
@ -106,7 +104,6 @@ x11_screen_destroy(struct x11_screen *xscr)
|
|||
xscr->glx_dpy->xscr = NULL;
|
||||
#endif
|
||||
|
||||
if (xscr->visuals)
|
||||
free(xscr->visuals);
|
||||
FREE(xscr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,10 +168,8 @@ xmesa_init_display( Display *display )
|
|||
xmdpy->screen->destroy(xmdpy->screen);
|
||||
xmdpy->screen = NULL;
|
||||
}
|
||||
if (xmdpy->smapi) {
|
||||
free(xmdpy->smapi);
|
||||
xmdpy->smapi = NULL;
|
||||
}
|
||||
|
||||
xmdpy->display = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -278,9 +278,7 @@ xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b)
|
|||
stfbi = CALLOC_STRUCT(st_framebuffer_iface);
|
||||
xstfb = CALLOC_STRUCT(xmesa_st_framebuffer);
|
||||
if (!stfbi || !xstfb) {
|
||||
if (stfbi)
|
||||
free(stfbi);
|
||||
if (xstfb)
|
||||
free(xstfb);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,11 +238,8 @@ combine_shaders(const struct shader_asm_info *shaders[SHADER_STAGES], int num_sh
|
|||
|
||||
ureg_destroy(ureg);
|
||||
|
||||
if (temp)
|
||||
free(temp);
|
||||
if (constant)
|
||||
free(constant);
|
||||
if (sampler)
|
||||
free(sampler);
|
||||
|
||||
return p;
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ static Status Validate(Display *dpy, XvPortID port, int surface_type_id, int xvi
|
|||
|
||||
subpictures = XvMCListSubpictureTypes(dpy, port, surface_type_id, &num_subpics);
|
||||
if (num_subpics < 1) {
|
||||
if (subpictures)
|
||||
free(subpictures);
|
||||
return BadMatch;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,6 @@ fail:
|
|||
if (xlib_handle)
|
||||
FREE(xlib_handle);
|
||||
|
||||
if (visinfo)
|
||||
free(visinfo);
|
||||
|
||||
if (win)
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ dri2_destroy_context(struct glx_context *context)
|
|||
|
||||
driReleaseDrawables(&pcp->base);
|
||||
|
||||
if (context->extensions)
|
||||
free((char *) context->extensions);
|
||||
|
||||
(*psc->core->destroyContext) (pcp->driContext);
|
||||
|
|
@ -313,7 +312,6 @@ dri2_create_context_attribs(struct glx_screen *base,
|
|||
return &pcp->base;
|
||||
|
||||
error_exit:
|
||||
if (pcp != NULL)
|
||||
free(pcp);
|
||||
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -495,7 +495,6 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc,
|
|||
if (framebuffer.base != MAP_FAILED)
|
||||
drmUnmap((drmAddress) framebuffer.base, framebuffer.size);
|
||||
|
||||
if (framebuffer.dev_priv != NULL)
|
||||
free(framebuffer.dev_priv);
|
||||
|
||||
if (fd >= 0)
|
||||
|
|
@ -516,7 +515,6 @@ dri_destroy_context(struct glx_context * context)
|
|||
|
||||
driReleaseDrawables(&pcp->base);
|
||||
|
||||
if (context->extensions)
|
||||
free((char *) context->extensions);
|
||||
|
||||
(*psc->core->destroyContext) (pcp->driContext);
|
||||
|
|
|
|||
|
|
@ -255,7 +255,6 @@ drisw_destroy_context(struct glx_context *context)
|
|||
|
||||
driReleaseDrawables(&pcp->base);
|
||||
|
||||
if (context->extensions)
|
||||
free((char *) context->extensions);
|
||||
|
||||
(*psc->core->destroyContext) (pcp->driContext);
|
||||
|
|
|
|||
|
|
@ -230,9 +230,7 @@ glx_display_free(struct glx_display *priv)
|
|||
}
|
||||
|
||||
FreeScreenConfigs(priv);
|
||||
if (priv->serverGLXvendor)
|
||||
free((char *) priv->serverGLXvendor);
|
||||
if (priv->serverGLXversion)
|
||||
free((char *) priv->serverGLXversion);
|
||||
|
||||
__glxHashDestroy(priv->glXDrawHash);
|
||||
|
|
@ -740,7 +738,6 @@ glx_screen_cleanup(struct glx_screen *psc)
|
|||
{
|
||||
if (psc->configs) {
|
||||
glx_config_destroy_list(psc->configs);
|
||||
if (psc->effectiveGLXexts)
|
||||
free(psc->effectiveGLXexts);
|
||||
psc->configs = NULL; /* NOTE: just for paranoia */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,13 +45,9 @@ indirect_destroy_context(struct glx_context *gc)
|
|||
{
|
||||
__glXFreeVertexArrayState(gc);
|
||||
|
||||
if (gc->vendor)
|
||||
free((char *) gc->vendor);
|
||||
if (gc->renderer)
|
||||
free((char *) gc->renderer);
|
||||
if (gc->version)
|
||||
free((char *) gc->version);
|
||||
if (gc->extensions)
|
||||
free((char *) gc->extensions);
|
||||
__glFreeAttributeState(gc);
|
||||
free((char *) gc->buf);
|
||||
|
|
|
|||
|
|
@ -115,14 +115,10 @@ __glXFreeVertexArrayState(struct glx_context * gc)
|
|||
struct array_state_vector *arrays = state->array_state;
|
||||
|
||||
if (arrays) {
|
||||
if (arrays->stack) {
|
||||
free(arrays->stack);
|
||||
arrays->stack = NULL;
|
||||
}
|
||||
if (arrays->arrays) {
|
||||
free(arrays->arrays);
|
||||
arrays->arrays = NULL;
|
||||
}
|
||||
free(arrays);
|
||||
state->array_state = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -989,7 +989,6 @@ void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info,
|
|||
XML_ParserFree (p);
|
||||
}
|
||||
|
||||
if (filenames[1])
|
||||
free(filenames[1]);
|
||||
}
|
||||
|
||||
|
|
@ -1000,7 +999,6 @@ void driDestroyOptionInfo (driOptionCache *info) {
|
|||
for (i = 0; i < size; ++i) {
|
||||
if (info->info[i].name) {
|
||||
free(info->info[i].name);
|
||||
if (info->info[i].ranges)
|
||||
free(info->info[i].ranges);
|
||||
}
|
||||
}
|
||||
|
|
@ -1009,7 +1007,6 @@ void driDestroyOptionInfo (driOptionCache *info) {
|
|||
}
|
||||
|
||||
void driDestroyOptionCache (driOptionCache *cache) {
|
||||
if (cache->values)
|
||||
free(cache->values);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -717,10 +717,8 @@ intel_buffer_object_purgeable(struct gl_context * ctx,
|
|||
return intel_buffer_purgeable(intel_obj->buffer);
|
||||
|
||||
if (option == GL_RELEASED_APPLE) {
|
||||
if (intel_obj->sys_buffer != NULL) {
|
||||
free(intel_obj->sys_buffer);
|
||||
intel_obj->sys_buffer = NULL;
|
||||
}
|
||||
|
||||
return GL_RELEASED_APPLE;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -150,11 +150,9 @@ intel_free_texture_image_buffer(struct gl_context * ctx,
|
|||
intelImage->base.Buffer = NULL;
|
||||
}
|
||||
|
||||
if (intelImage->base.ImageOffsets) {
|
||||
free(intelImage->base.ImageOffsets);
|
||||
intelImage->base.ImageOffsets = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Map texture memory/buffer into user space.
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ static void radeon_destroy_atom_list(radeonContextPtr radeon)
|
|||
|
||||
foreach(atom, &radeon->hw.atomlist) {
|
||||
free(atom->cmd);
|
||||
if (atom->lastcmd)
|
||||
free(atom->lastcmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,11 +148,9 @@ void radeonFreeTextureImageBuffer(struct gl_context *ctx, struct gl_texture_imag
|
|||
image->base.Buffer = NULL;
|
||||
}
|
||||
|
||||
if (image->base.ImageOffsets) {
|
||||
free(image->base.ImageOffsets);
|
||||
image->base.ImageOffsets = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set Data pointer and additional data for mapped texture image */
|
||||
static void teximage_set_map_data(radeon_texture_image *image)
|
||||
|
|
|
|||
|
|
@ -779,9 +779,7 @@ choose_x_overlay_visual( Display *dpy, int scr,
|
|||
|
||||
if (deepvis==NULL || vislist->depth > deepest) {
|
||||
/* YES! found a satisfactory visual */
|
||||
if (deepvis) {
|
||||
free(deepvis);
|
||||
}
|
||||
deepest = vislist->depth;
|
||||
deepvis = vislist;
|
||||
/* DEBUG tt = ov->transparent_type;*/
|
||||
|
|
|
|||
|
|
@ -83,9 +83,7 @@ _mesa_delete_ati_fragment_shader(struct gl_context *ctx, struct ati_fragment_sha
|
|||
{
|
||||
GLuint i;
|
||||
for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
|
||||
if (s->Instructions[i])
|
||||
free(s->Instructions[i]);
|
||||
if (s->SetupInst[i])
|
||||
free(s->SetupInst[i]);
|
||||
}
|
||||
free(s);
|
||||
|
|
@ -342,9 +340,7 @@ _mesa_BeginFragmentShaderATI(void)
|
|||
(or, could use the same mem but would need to reinitialize) */
|
||||
/* no idea if it's allowed to redefine a shader */
|
||||
for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
|
||||
if (ctx->ATIFragmentShader.Current->Instructions[i])
|
||||
free(ctx->ATIFragmentShader.Current->Instructions[i]);
|
||||
if (ctx->ATIFragmentShader.Current->SetupInst[i])
|
||||
free(ctx->ATIFragmentShader.Current->SetupInst[i]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -264,7 +264,6 @@ _mesa_delete_buffer_object(struct gl_context *ctx,
|
|||
{
|
||||
(void) ctx;
|
||||
|
||||
if (bufObj->Data)
|
||||
free(bufObj->Data);
|
||||
|
||||
/* assign strange values here to help w/ debugging */
|
||||
|
|
|
|||
|
|
@ -1158,10 +1158,8 @@ _mesa_free_context_data( struct gl_context *ctx )
|
|||
|
||||
_mesa_free_errors_data(ctx);
|
||||
|
||||
if (ctx->Extensions.String)
|
||||
free((void *)ctx->Extensions.String);
|
||||
|
||||
if (ctx->VersionString)
|
||||
free(ctx->VersionString);
|
||||
|
||||
/* unbind the context if it's currently bound */
|
||||
|
|
|
|||
|
|
@ -218,7 +218,6 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize)
|
|||
void *newBuffer = malloc(newSize);
|
||||
if (newBuffer && oldBuffer && copySize > 0)
|
||||
memcpy(newBuffer, oldBuffer, copySize);
|
||||
if (oldBuffer)
|
||||
free(oldBuffer);
|
||||
return newBuffer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -703,9 +703,7 @@ shader_source(struct gl_context *ctx, GLuint shader, const GLchar *source)
|
|||
return;
|
||||
|
||||
/* free old shader source string and install new one */
|
||||
if (sh->Source) {
|
||||
free((void *)sh->Source);
|
||||
}
|
||||
sh->Source = source;
|
||||
sh->CompileStatus = GL_FALSE;
|
||||
#ifdef DEBUG
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
|
|||
static void
|
||||
_mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh)
|
||||
{
|
||||
if (sh->Source)
|
||||
free((void *)sh->Source);
|
||||
_mesa_reference_program(ctx, &sh->Program, NULL);
|
||||
ralloc_free(sh);
|
||||
|
|
@ -333,10 +332,8 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
|
|||
}
|
||||
shProg->NumShaders = 0;
|
||||
|
||||
if (shProg->Shaders) {
|
||||
free(shProg->Shaders);
|
||||
shProg->Shaders = NULL;
|
||||
}
|
||||
|
||||
/* Transform feedback varying vars */
|
||||
for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) {
|
||||
|
|
|
|||
|
|
@ -214,7 +214,6 @@ _mesa_cpal_compressed_teximage2d(GLenum target, GLint level,
|
|||
|
||||
_mesa_TexImage2D(target, lvl, info->format, w, h, 0,
|
||||
info->format, info->type, image);
|
||||
if (image)
|
||||
free(image);
|
||||
|
||||
/* advance index pointer to point to next src mipmap */
|
||||
|
|
|
|||
|
|
@ -1361,10 +1361,8 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
|
|||
}
|
||||
|
||||
cleanUp:
|
||||
if (newSource != NULL) {
|
||||
free(newSource);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
|
|||
return;
|
||||
}
|
||||
|
||||
if (program->Base.String != NULL)
|
||||
free(program->Base.String);
|
||||
|
||||
/* Copy the relevant contents of the arb_program struct into the
|
||||
|
|
@ -122,7 +121,6 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
|
|||
program->UsesKill = state.fragment.UsesKill;
|
||||
program->UsesDFdy = state.fragment.UsesDFdy;
|
||||
|
||||
if (program->Base.Instructions)
|
||||
free(program->Base.Instructions);
|
||||
program->Base.Instructions = prog.Instructions;
|
||||
|
||||
|
|
@ -179,7 +177,6 @@ _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target,
|
|||
return;
|
||||
}
|
||||
|
||||
if (program->Base.String != NULL)
|
||||
free(program->Base.String);
|
||||
|
||||
/* Copy the relevant contents of the arb_program struct into the
|
||||
|
|
@ -202,7 +199,6 @@ _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target,
|
|||
program->IsPositionInvariant = (state.option.PositionInvariant)
|
||||
? GL_TRUE : GL_FALSE;
|
||||
|
||||
if (program->Base.Instructions)
|
||||
free(program->Base.Instructions);
|
||||
program->Base.Instructions = prog.Instructions;
|
||||
|
||||
|
|
|
|||
|
|
@ -1549,14 +1549,10 @@ _mesa_parse_nv_fragment_program(struct gl_context *ctx, GLenum dstTarget,
|
|||
|
||||
/* install the program */
|
||||
program->Base.Target = target;
|
||||
if (program->Base.String) {
|
||||
free(program->Base.String);
|
||||
}
|
||||
program->Base.String = programString;
|
||||
program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB;
|
||||
if (program->Base.Instructions) {
|
||||
free(program->Base.Instructions);
|
||||
}
|
||||
program->Base.Instructions = newInst;
|
||||
program->Base.NumInstructions = parseState.numInst;
|
||||
program->Base.InputsRead = parseState.inputsRead;
|
||||
|
|
|
|||
|
|
@ -1382,14 +1382,10 @@ _mesa_parse_nv_vertex_program(struct gl_context *ctx, GLenum dstTarget,
|
|||
|
||||
/* install the program */
|
||||
program->Base.Target = target;
|
||||
if (program->Base.String) {
|
||||
free(program->Base.String);
|
||||
}
|
||||
program->Base.String = programString;
|
||||
program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB;
|
||||
if (program->Base.Instructions) {
|
||||
free(program->Base.Instructions);
|
||||
}
|
||||
program->Base.Instructions = newInst;
|
||||
program->Base.InputsRead = parseState.inputsRead;
|
||||
if (parseState.isPositionInvariant)
|
||||
|
|
|
|||
|
|
@ -127,9 +127,7 @@ _mesa_free_instructions(struct prog_instruction *inst, GLuint count)
|
|||
{
|
||||
GLuint i;
|
||||
for (i = 0; i < count; i++) {
|
||||
if (inst[i].Data)
|
||||
free(inst[i].Data);
|
||||
if (inst[i].Comment)
|
||||
free((char *)inst[i].Comment);
|
||||
}
|
||||
free(inst);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList)
|
|||
{
|
||||
GLuint i;
|
||||
for (i = 0; i < paramList->NumParameters; i++) {
|
||||
if (paramList->Parameters[i].Name)
|
||||
free((void *)paramList->Parameters[i].Name);
|
||||
}
|
||||
free(paramList->Parameters);
|
||||
|
|
|
|||
|
|
@ -382,7 +382,6 @@ _mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
|
|||
if (prog == &_mesa_DummyProgram)
|
||||
return;
|
||||
|
||||
if (prog->String)
|
||||
free(prog->String);
|
||||
|
||||
if (prog->Instructions) {
|
||||
|
|
|
|||
|
|
@ -835,7 +835,6 @@ fallback_copy_texsubimage(struct gl_context *ctx,
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
|
||||
}
|
||||
|
||||
if (tempSrc)
|
||||
free(tempSrc);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -829,7 +829,6 @@ _swrast_DestroyContext( struct gl_context *ctx )
|
|||
}
|
||||
|
||||
free( swrast->SpanArrays );
|
||||
if (swrast->ZoomedArrays)
|
||||
free( swrast->ZoomedArrays );
|
||||
free( swrast->TexelBuffer );
|
||||
|
||||
|
|
|
|||
|
|
@ -493,9 +493,7 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
|
|||
span.array->ChanType = CHAN_TYPE;
|
||||
}
|
||||
|
||||
if (convImage) {
|
||||
free(convImage);
|
||||
}
|
||||
|
||||
swrast_render_finish(ctx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,10 +119,8 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
|
|||
bpp = _mesa_get_format_bytes(rb->Format);
|
||||
|
||||
/* free old buffer storage */
|
||||
if (srb->Buffer) {
|
||||
free(srb->Buffer);
|
||||
srb->Buffer = NULL;
|
||||
}
|
||||
|
||||
srb->RowStride = width * bpp;
|
||||
|
||||
|
|
@ -170,10 +168,8 @@ soft_renderbuffer_delete(struct gl_renderbuffer *rb)
|
|||
{
|
||||
struct swrast_renderbuffer *srb = swrast_renderbuffer(rb);
|
||||
|
||||
if (srb->Buffer) {
|
||||
free(srb->Buffer);
|
||||
srb->Buffer = NULL;
|
||||
}
|
||||
_mesa_delete_renderbuffer(rb);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,11 +144,9 @@ _swrast_free_texture_image_buffer(struct gl_context *ctx,
|
|||
swImage->Buffer = NULL;
|
||||
}
|
||||
|
||||
if (swImage->ImageOffsets) {
|
||||
free(swImage->ImageOffsets);
|
||||
swImage->ImageOffsets = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -589,8 +589,8 @@ static void free_texgen_data( struct tnl_pipeline_stage *stage )
|
|||
_mesa_vector4f_free( &store->texcoord[i] );
|
||||
|
||||
|
||||
if (store->tmp_f) free( store->tmp_f );
|
||||
if (store->tmp_m) free( store->tmp_m );
|
||||
free( store->tmp_f );
|
||||
free( store->tmp_m );
|
||||
free( store );
|
||||
stage->privatePtr = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -226,8 +226,6 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
if (sub_prims) {
|
||||
free(sub_prims);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -242,10 +242,8 @@ void vbo_rebase_prims( struct gl_context *ctx,
|
|||
ctx->Array._DrawArrays = saved_arrays;
|
||||
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
|
||||
|
||||
if (tmp_indices)
|
||||
free(tmp_indices);
|
||||
|
||||
if (tmp_prims)
|
||||
free(tmp_prims);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1577,11 +1577,9 @@ vbo_destroy_vertex_list(struct gl_context *ctx, void *data)
|
|||
if (--node->prim_store->refcount == 0)
|
||||
free(node->prim_store);
|
||||
|
||||
if (node->current_data) {
|
||||
free(node->current_data);
|
||||
node->current_data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue