Fixes: https://github.com/karelzak/util-linux/issues/1434
Signed-off-by: Karel Zak <kzak@redhat.com>
sz = strlen(str) + 1;
p = malloc(sizeof(struct ul_env_list) + sz);
+ if (!p)
+ return ls0;
ls = (struct ul_env_list *) p;
p += sizeof(struct ul_env_list);
}
/*
- * Removes unwanted variables from environ[]. If @ls is not NULL than stores
+ * Removes unwanted variables from environ[]. If @org is not NULL than stores
* unwnated variables to the list.
*/
void __sanitize_env(struct ul_env_list **org)