* Copyright 2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* Copyright 2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
- my_env = malloc(need);
- _nc_SPRINTF(my_env, _nc_SLIMIT(need) "TERM=%s", optarg);
- putenv(my_env);
+ if ((my_env = malloc(need)) != NULL) {
+ _nc_SPRINTF(my_env, _nc_SLIMIT(need) "TERM=%s", optarg);
+ putenv(my_env);
+ }