1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

python: Check return value of talloc_strndup()

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-07-28 08:14:47 +12:00 committed by Andrew Bartlett
parent b270333fe4
commit fa9f9d4915

View File

@ -102,6 +102,11 @@ char **PyList_AsStringList(TALLOC_CTX *mem_ctx, PyObject *list,
return NULL;
}
ret[i] = talloc_strndup(ret, value, size);
if (ret[i] == NULL) {
PyErr_NoMemory();
talloc_free(ret);
return NULL;
}
}
ret[i] = NULL;
return ret;