projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ba370a
)
gallium: added null ptr check in align_free()
author
Brian Paul
<brianp@vmware.com>
Thu, 5 Mar 2009 17:01:17 +0000
(10:01 -0700)
committer
Brian Paul
<brianp@vmware.com>
Thu, 5 Mar 2009 17:01:28 +0000
(10:01 -0700)
src/gallium/auxiliary/util/u_memory.h
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/util/u_memory.h
b/src/gallium/auxiliary/util/u_memory.h
index ceb3a1cb6154d20b9ad8d3ef826c8d5e6e4a8748..0b18d043adb2a52cee9abc8961c3b17cd950b3b2 100644
(file)
--- a/
src/gallium/auxiliary/util/u_memory.h
+++ b/
src/gallium/auxiliary/util/u_memory.h
@@
-191,9
+191,11
@@
align_free(void *ptr)
#if defined(HAVE_POSIX_MEMALIGN)
FREE(ptr);
#else
- void **cubbyHole = (void **) ((char *) ptr - sizeof(void *));
- void *realAddr = *cubbyHole;
- FREE(realAddr);
+ if (ptr) {
+ void **cubbyHole = (void **) ((char *) ptr - sizeof(void *));
+ void *realAddr = *cubbyHole;
+ FREE(realAddr);
+ }
#endif /* defined(HAVE_POSIX_MEMALIGN) */
}