]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
main(): catch PyUnicode_FromString() failure (exit)
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 13 Oct 2010 22:36:16 +0000 (22:36 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 13 Oct 2010 22:36:16 +0000 (22:36 +0000)
Modules/python.c

index 540bcfe1a4de5a422501621e619c029ac8346dc2..488aa791d7025bd4058e1b178f2314e1caa66657 100644 (file)
@@ -44,6 +44,8 @@ main(int argc, char **argv)
 #ifdef __APPLE__
         /* Use utf-8 on Mac OS X */
         PyObject *unicode = PyUnicode_FromString(argv[i]);
+        if (!unicode)
+            return 1;
         argv_copy[i] = PyUnicode_AsWideCharString(unicode, NULL);
         Py_DECREF(unicode);
 #else