mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-13 23:52:30 +00:00
concurrent: check realloc() rc and exit on failure
Signed-off-by: Arjun Sreedharan <arjun024@gmail.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
0cc417b20f
commit
ea7e3744e7
@ -182,6 +182,10 @@ int main(int argc, char *argv[]) {
|
||||
(tok = strtok_r(mode_tok, ",", &saveptr));
|
||||
i++, mode_tok = NULL) {
|
||||
modes = realloc(modes, sizeof(*modes) * (i+2));
|
||||
if (!modes) {
|
||||
perror("realloc");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
modes[i] = tok;
|
||||
}
|
||||
modes[i] = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user