Fix NULL dereference
* libmailutils/mime/mimehdr.c (mu_mime_param_free): Check if argument is NULL.
Showing
1 changed file
with
7 additions
and
4 deletions
... | @@ -48,10 +48,13 @@ | ... | @@ -48,10 +48,13 @@ |
48 | void | 48 | void |
49 | mu_mime_param_free (struct mu_mime_param *p) | 49 | mu_mime_param_free (struct mu_mime_param *p) |
50 | { | 50 | { |
51 | free (p->lang); | 51 | if (p) |
52 | free (p->cset); | 52 | { |
53 | free (p->value); | 53 | free (p->lang); |
54 | free (p); | 54 | free (p->cset); |
55 | free (p->value); | ||
56 | free (p); | ||
57 | } | ||
55 | } | 58 | } |
56 | 59 | ||
57 | /* Treat ITEM as a pointer to struct mu_mime_param and reclaim all | 60 | /* Treat ITEM as a pointer to struct mu_mime_param and reclaim all | ... | ... |
-
Please register or sign in to post a comment