]> granicus.if.org Git - python/commitdiff
Issue #17810: Add NULL check to save_frozenset
authorChristian Heimes <christian@cheimes.de>
Sat, 23 Nov 2013 20:01:40 +0000 (21:01 +0100)
committerChristian Heimes <christian@cheimes.de>
Sat, 23 Nov 2013 20:01:40 +0000 (21:01 +0100)
CID 1131949:  Dereference null return value  (NULL_RETURNS)

Modules/_pickle.c

index f9aa043a42fc79271ea9bc0e966d846d567665ef..b63a7d92c54ff19f5cc04f54652d79c5ce5077c4 100644 (file)
@@ -2940,6 +2940,9 @@ save_frozenset(PicklerObject *self, PyObject *obj)
         return -1;
 
     iter = PyObject_GetIter(obj);
+    if (iter == NULL) {
+        return NULL;
+    }
     for (;;) {
         PyObject *item;