tFixing one more segfault in the new code. - rohrpost - A commandline mail client to change the world as we see it.
 (HTM) git clone git://r-36.net/rohrpost
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit ae0fddb3858de5e8121bfe60325ceb64997a1b58
 (DIR) parent 3c36af4748cd8f0b941085113d53b4baaa801eee
 (HTM) 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:
         mime.c                              |      10 ++++++++--
       
       1 file changed, 8 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/mime.c b/mime.c
       t@@ -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;
       t@@ -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);