]> www.wagner.pp.ru Git - oss/catdoc.git/blobdiff - src/charsets.c
Merge branch 'master' of http://wagner.pp.ru/git/oss/catdoc
[oss/catdoc.git] / src / charsets.c
index eda5cb4caa24e413357b779c229cd8e5150766bb..e64e24c07a267d13b223d46217a79ff51600d900 100644 (file)
@@ -69,7 +69,7 @@ CHARSET make_reverse_map(short int *charset) {
 /************************************************************************/
 /* Reads charset file (as got from ftp.unicode.org) and returns array of*/
 /* 256 short ints (malloced) mapping from charset t unicode             */
-/************************************************************************/int * read_charset(const char *filename) {
+/************************************************************************/
 uint16_t * read_charset(const char *filename) {
        char *path;
        FILE *f;
@@ -99,6 +99,7 @@ uint16_t * 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);
+                               free(new);
                                return NULL;
                        }
                        new[c]=uc;