dtcm: Coverity 88741, 88121 and 88692
authorPeter Howkins <flibble@users.sf.net>
Wed, 4 Jul 2018 21:27:43 +0000 (22:27 +0100)
committerPeter Howkins <flibble@users.sf.net>
Wed, 4 Jul 2018 21:27:43 +0000 (22:27 +0100)
cde/programs/dtcm/dtcm/RFCMIME.c

index bde71f7ad948535b8a545fe70f73ba7bd510c446..efdc8e29041804518e61ab700c1553f351f88f7b 100644 (file)
@@ -514,6 +514,9 @@ CvtStr( char *charSet, void *from, unsigned long from_len,
                                &InterChCodeSet );
        } else {
            /* Convert charSet to StdInterChangeCodeSet */
+           free(ret_locale);
+           free(ret_lang);
+           free(ret_codeset);
            ret_locale = ret_lang = ret_codeset = NULL;
            DtXlateOpToStdLocale( DtLCX_OPER_MIME,
                                charSet,
@@ -551,6 +554,9 @@ CvtStr( char *charSet, void *from, unsigned long from_len,
 #endif /* _AIX */
            {
                /* Convert InterChCodeSet to StdCodeSet */
+               free(ret_locale);
+               free(ret_lang);
+               free(ret_codeset);
                ret_locale = ret_lang = ret_codeset = NULL;
                DtXlateOpToStdLocale( DtLCX_OPER_INTERCHANGE_CODESET,
                                InterChCodeSet,
@@ -579,6 +585,9 @@ CvtStr( char *charSet, void *from, unsigned long from_len,
                                &from_codeset );
        } else {
            /* Convert charSet to StdInterChangeCodeSet */
+           free(ret_locale);
+           free(ret_lang);
+           free(ret_codeset);
            ret_locale = ret_lang = ret_codeset = NULL;
            DtXlateOpToStdLocale( DtLCX_OPER_MIME,
                                charSet,
@@ -606,6 +615,9 @@ CvtStr( char *charSet, void *from, unsigned long from_len,
                                &InterChCodeSet );
        } else {
            /* Convert charSet to StdInterChangeCodeSet */
+           free(ret_locale);
+           free(ret_lang);
+           free(ret_codeset);
            ret_locale = ret_lang = ret_codeset = NULL;
            DtXlateOpToStdLocale( DtLCX_OPER_MIME,
                                charSet,
@@ -623,6 +635,10 @@ CvtStr( char *charSet, void *from, unsigned long from_len,
                                &to_codeset );
     }
 
+    free(ret_locale);
+    free(ret_lang);
+    free(ret_codeset);
+
     *to = NULL;
     *to_len = 0;