commit ae0fddb3858de5e8121bfe60325ceb64997a1b58
parent 3c36af4748cd8f0b941085113d53b4baaa801eee
Author: Christoph Lohmann <20h@r-36.net>
Date: Sun, 2 Apr 2017 22:01:46 +0200
Fixing one more segfault in the new code.
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/mime.c b/mime.c
@@ -216,8 +216,11 @@ mime_decodeheaderext(char *value)
free(ret);
if (strcasecmp(cs, "utf-8")) {
dstr = mime_iconv(cret, cs, "UTF-8");
- if (dstr == NULL)
+ if (dstr == NULL) {
str = smprintf("ERR(%s)", str);
+ } else {
+ str = dstr;
+ }
free(cret);
} else {
str = cret;
@@ -402,8 +405,11 @@ mime_decodeparam(char *value)
if (strcasecmp(cs, "utf-8")) {
free(ret);
dstr = mime_iconv(cret, cs, "UTF-8");
- if (dstr == NULL)
+ if (dstr == NULL) {
str = smprintf("ERR(%s)", str);
+ } else {
+ str = dstr;
+ }
free(cret);
} else {
free(ret);