From: Christian Heimes Date: Sun, 21 Jul 2013 21:05:11 +0000 (+0200) Subject: Now all error paths of _freeze_importlib use 'goto error' and the error label cleans... X-Git-Tag: v3.4.0a1~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5378e2223c00bdf3b7eb36a9c19b89d24feb0f9;p=python Now all error paths of _freeze_importlib use 'goto error' and the error label cleans up all used resources. --- e5378e2223c00bdf3b7eb36a9c19b89d24feb0f9 diff --cc Modules/_freeze_importlib.c index 75013e1ef0,8f07a89a8a..57b1ac0662 --- a/Modules/_freeze_importlib.c +++ b/Modules/_freeze_importlib.c @@@ -104,11 -103,10 +103,10 @@@ main(int argc, char *argv[] outfile = fopen(outpath, "w"); if (outfile == NULL) { fprintf(stderr, "cannot open '%s' for writing\n", outpath); - Py_DECREF(marshalled); - return 1; + goto error; } fprintf(outfile, "%s\n", header); - fprintf(outfile, "unsigned char _Py_M__importlib[] = {\n"); + fprintf(outfile, "const unsigned char _Py_M__importlib[] = {\n"); for (n = 0; n < data_size; n += 16) { size_t i, end = Py_MIN(n + 16, data_size); fprintf(outfile, " ");