]> www.wagner.pp.ru Git - oss/catdoc.git/blobdiff - src/charsets.c
Fix resource leaks found by cppcheck
[oss/catdoc.git] / src / charsets.c
index 49875e3b4f27f4251d4778fefed382ed135040be..05118767815072f301bee1cd0f202d3249d55079 100644 (file)
@@ -99,6 +99,7 @@ short int * read_charset(const char *filename) {
                        if (c<0||c>255||uc<0||(uc>0xFEFE&& uc!=0xFFFE)) {
                                fprintf(stderr,"Invalid charset file %s\n",path);
                                fclose(f);
                        if (c<0||c>255||uc<0||(uc>0xFEFE&& uc!=0xFFFE)) {
                                fprintf(stderr,"Invalid charset file %s\n",path);
                                fclose(f);
+                               free(new);
                                return NULL;
                        }
                        new[c]=uc;
                                return NULL;
                        }
                        new[c]=uc;