mirror of
https://github.com/python/cpython.git
synced 2024-11-28 08:20:55 +01:00
fix memory leak and null pointer dereference
This commit is contained in:
parent
946805d418
commit
c206c766dd
@ -523,6 +523,8 @@ int_pow(v, w, z)
|
||||
XDECREF(t2);
|
||||
return(NULL);
|
||||
}
|
||||
DECREF(t1);
|
||||
DECREF(t2);
|
||||
ix=mod;
|
||||
}
|
||||
return newintobject(ix);
|
||||
|
@ -552,7 +552,9 @@ x_divrem(v1, w1, prem)
|
||||
}
|
||||
} /* for j, k */
|
||||
|
||||
if (a != NULL) {
|
||||
if (a == NULL)
|
||||
*prem = NULL;
|
||||
else {
|
||||
a = long_normalize(a);
|
||||
*prem = divrem1(v, d, &d);
|
||||
/* d receives the (unused) remainder */
|
||||
@ -1001,7 +1003,7 @@ long_pow(a, b, c)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (a == NULL)
|
||||
if (a == NULL || z == NULL)
|
||||
break;
|
||||
}
|
||||
XDECREF(a);
|
||||
|
Loading…
Reference in New Issue
Block a user