]> granicus.if.org Git - python/commitdiff
Issue #17810: Add two missing error checks to save_global
authorChristian Heimes <christian@cheimes.de>
Sat, 23 Nov 2013 20:13:39 +0000 (21:13 +0100)
committerChristian Heimes <christian@cheimes.de>
Sat, 23 Nov 2013 20:13:39 +0000 (21:13 +0100)
CID 1131946:  Unchecked return value  (CHECKED_RETURN)

Modules/_pickle.c

index a1819b993d56c74c36739be6fcff0b6930ec714e..4e0d86c69ccde4de4d82c4f69272458da83b5aa5 100644 (file)
@@ -3193,8 +3193,10 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
         if (self->proto >= 4) {
             const char stack_global_op = STACK_GLOBAL;
 
-            save(self, module_name, 0);
-            save(self, global_name, 0);
+            if (save(self, module_name, 0) < 0)
+                goto error;
+            if (save(self, global_name, 0) < 0)
+                goto error;
 
             if (_Pickler_Write(self, &stack_global_op, 1) < 0)
                 goto error;