src/textcat.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit c30e4bb69006a00c5677e7f08e2343108be575df
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat May 16 17:51:15 2026 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat May 16 18:51:37 2026 +0200

    fix error path leak
    
    Change-Id: I818c5785b06bd36977dd2a50823377f852d0bbb7
    Reviewed-on: https://gerrit.libreoffice.org/c/libexttextcat/+/205240
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/src/textcat.c b/src/textcat.c
index 062f566..9b41b68 100644
--- a/src/textcat.c
+++ b/src/textcat.c
@@ -222,6 +222,7 @@ extern void *special_textcat_Init(const char *conffile, 
const char *prefix)
                                 sizeof(char) * (tmp_size + 1));
             if (tmp == NULL)
             {
+                fp_Done(h->fprint[h->size]);
                 goto BAILOUT;
             }
             else
@@ -234,7 +235,10 @@ extern void *special_textcat_Init(const char *conffile, 
const char *prefix)
         strcat(finger_print_file_name, segment[0]);
 
         if (fp_Read(h->fprint[h->size], finger_print_file_name, 400) == 0)
+        {
+            fp_Done(h->fprint[h->size]);
             goto BAILOUT;
+        }
         h->fprint_disable[h->size] = 0xF0;  /* 0xF0 is the code for enabled
                                                languages, 0x0F is for disabled 
                                              */

Reply via email to