fix leak
[m6w6/ext-psi] / src / parser.re
index 59c8bdaf141d12136b62afe2b794d884166fb2e9..a313ac91a7e73ae0ec397c164b91dd1c49d66f13 100644 (file)
@@ -181,10 +181,10 @@ static void psi_parser_register_constants(struct psi_parser *P)
 }
 #endif
 
-struct psi_plist *psi_parser_preprocess(struct psi_parser *P, struct psi_plist *tokens)
+struct psi_plist *psi_parser_preprocess(struct psi_parser *P, struct psi_plist **tokens)
 {
-       if (psi_cpp_process(P->preproc, &tokens)) {
-               return tokens;
+       if (psi_cpp_process(P->preproc, tokens)) {
+               return *tokens;
        }
        return NULL;
 }
@@ -206,7 +206,7 @@ bool psi_parser_parse(struct psi_parser *P, struct psi_parser_input *I)
                return false;
        }
 
-       if (!(preproc = psi_parser_preprocess(P, scanned))) {
+       if (!(preproc = psi_parser_preprocess(P, &scanned))) {
                psi_plist_free(scanned);
                return false;
        }