summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/mime_magic/mime_magic.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c
index a345dc2e20..05d02d13d7 100644
--- a/ext/mime_magic/mime_magic.c
+++ b/ext/mime_magic/mime_magic.c
@@ -1954,9 +1954,8 @@ static int magic_rsl_get(char **content_type, char **content_encoding)
}
/* detect memory allocation errors */
- if (!content_type ||
- (state == rsl_encoding && !*content_encoding)) {
- return MIME_MAGIC_ERROR;
+ if (!content_type || !(*content_type) || (state == rsl_encoding && !*content_encoding)) {
+ return MIME_MAGIC_ERROR;
}
/* success! */