Skip to content

ft_strdup key and value before entering and exiting t_env

Noah Loomans requested to merge env_strdup into master

This solves a couple of easy to miss bugs:

char *value = env_get(env, "key");
value[10] = 'a'; // BUG - value in env struct has now been updated

char *value = env_set(env, "key", "value");
env_unset("key"); // BUG - program crashes while attempting to free
                  // key and value.

Merge request reports