summaryrefslogtreecommitdiff
path: root/plugins/elf/python/dynamic.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/elf/python/dynamic.c')
-rw-r--r--plugins/elf/python/dynamic.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/plugins/elf/python/dynamic.c b/plugins/elf/python/dynamic.c
index aaf4f6a..974b751 100644
--- a/plugins/elf/python/dynamic.c
+++ b/plugins/elf/python/dynamic.c
@@ -145,22 +145,14 @@ PyObject *py_elf_format_get_needed(PyObject *self, void *closure)
needed = list_elf_needed_objects(format, &count);
- if (count > 0)
- {
- result = PyTuple_New(count);
+ result = PyTuple_New(count);
- for (i = 0; i < count; i++)
- PyTuple_SetItem(result, i, PyUnicode_FromString(needed[i]));
+ for (i = 0; i < count; i++)
+ PyTuple_SetItem(result, i, PyUnicode_FromString(needed[i]));
+ if (needed != NULL)
free(needed);
- }
- else
- {
- result = Py_None;
- Py_INCREF(result);
- }
-
return result;
}