File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ main(int argc, char *argv[])
7272 if (n < text_size ) {
7373 fprintf (stderr , "read too short: got %ld instead of %ld bytes\n" ,
7474 (long ) n , (long ) text_size );
75+ free (text );
7576 return 1 ;
7677 }
7778 text [text_size ] = '\0' ;
@@ -86,6 +87,7 @@ main(int argc, char *argv[])
8687
8788 code = Py_CompileStringExFlags (text , "<frozen importlib._bootstrap>" ,
8889 Py_file_input , NULL , 0 );
90+ free (text );
8991 if (code == NULL )
9092 goto error ;
9193 marshalled = PyMarshal_WriteObjectToString (code , Py_MARSHAL_VERSION );
@@ -102,6 +104,7 @@ main(int argc, char *argv[])
102104 outfile = fopen (outpath , "w" );
103105 if (outfile == NULL ) {
104106 fprintf (stderr , "cannot open '%s' for writing\n" , outpath );
107+ Py_DECREF (marshalled );
105108 return 1 ;
106109 }
107110 fprintf (outfile , "%s\n" , header );
You can’t perform that action at this time.
0 commit comments