lib/env_dpdk: exit if allocating dpdk_args fails
Change-Id: Ib7268d679ed73e73b5bc20f08dc381315ee4fd9d Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
This commit is contained in:
parent
48ee3eba39
commit
118c08154e
@ -297,6 +297,10 @@ void spdk_env_init(const struct spdk_env_opts *opts)
|
|||||||
* correctly.
|
* correctly.
|
||||||
*/
|
*/
|
||||||
dpdk_args = calloc(argcount, sizeof(char *));
|
dpdk_args = calloc(argcount, sizeof(char *));
|
||||||
|
if (dpdk_args == NULL) {
|
||||||
|
fprintf(stderr, "Failed to allocate dpdk_args\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
memcpy(dpdk_args, args, sizeof(char *) * argcount);
|
memcpy(dpdk_args, args, sizeof(char *) * argcount);
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
Loading…
Reference in New Issue
Block a user