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:
parent
b270333fe4
commit
fa9f9d4915
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user