Use PyErr_NoMemory when CPU_ALLOC fails
Its the proper function to use when not enough memory is available.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/python-schedutils/schedutils.c b/python-schedutils/schedutils.c
index c6cc6fd..bdc4117 100644
--- a/python-schedutils/schedutils.c
+++ b/python-schedutils/schedutils.c
@@ -126,7 +126,7 @@
cpus = CPU_ALLOC(max_cpus);
if (cpus == NULL)
- goto out_error;
+ return PyErr_NoMemory();
cpusetsize = CPU_ALLOC_SIZE(max_cpus);
CPU_ZERO_S(cpusetsize, cpus);
@@ -165,7 +165,7 @@
cpus = CPU_ALLOC(max_cpus);
if (cpus == NULL)
- goto out_error;
+ return PyErr_NoMemory();
cpusetsize = CPU_ALLOC_SIZE(max_cpus);
CPU_ZERO_S(cpusetsize, cpus);