diff --git a/riverguile.c b/riverguile.c index 25acf15..b2804ae 100644 --- a/riverguile.c +++ b/riverguile.c @@ -375,7 +375,10 @@ static char *get_script_path (void) for (size_t i = 0; i < (sizeof(paths) / sizeof(paths[0])); i++) { if ( path != NULL ) + { free(path); + path = NULL; + } /* Path needs env var, but it is not set. */ if ( paths[i].needs_env && paths[i].env == NULL )