Fix NULL dereference
* libmailutils/mime/mimehdr.c (mu_mime_param_free): Check if argument is NULL.
Showing
1 changed file
with
3 additions
and
0 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 | if (p) | ||
52 | { | ||
51 | free (p->lang); | 53 | free (p->lang); |
52 | free (p->cset); | 54 | free (p->cset); |
53 | free (p->value); | 55 | free (p->value); |
54 | free (p); | 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