summaryrefslogtreecommitdiff
path: root/css
diff options
context:
space:
mode:
Diffstat (limited to 'css')
-rw-r--r--css/css.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/css/css.c b/css/css.c
index f051d52b9..7fb17519b 100644
--- a/css/css.c
+++ b/css/css.c
@@ -60,6 +60,11 @@ static nserror nscss_import(hlcache_handle *handle,
*/
static void *myrealloc(void *ptr, size_t size, void *pw)
{
+ if (size == 0) {
+ free(ptr);
+ return NULL;
+ }
+
return realloc(ptr, size);
}