nouveau: don't keep stale pointer to free'd data
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 16 Aug 2014 06:46:01 +0000 (02:46 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 16 Aug 2014 21:52:54 +0000 (17:52 -0400)
If ->sys is non-null, we might decide that it's where the data is
stored.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c

index 9a3d41739b9ebfd454a3cfe2518da6a5eae20852..2bb633e1047883923b20f1f75ba80cb285c71647 100644 (file)
@@ -86,6 +86,7 @@ nouveau_bufferobj_data(struct gl_context *ctx, GLenum target, GLsizeiptrARB size
        /* Free previous storage */
        nouveau_bo_ref(NULL, &nbo->bo);
        free(nbo->sys);
+       nbo->sys = NULL;
 
        if (target == GL_ELEMENT_ARRAY_BUFFER_ARB ||
            (size < 512 && usage == GL_DYNAMIC_DRAW_ARB) ||