Fix memory leak in dir_hash_add_file().
The duplicated targetnorm used for calling dir_hash_create_dir is never affected anywhere. It is duplicated again before affectation. And thus,
leaks.

svn path=/trunk/; revision=59581
This commit is contained in:
Pierre Schweitzer 2013-07-25 15:04:56 +00:00
parent b5c485fb74
commit 0e19688298

View file

@ -139,6 +139,7 @@ void dir_hash_add_file(struct target_dir_hash *dh, const char *source, const cha
targetnorm = strdup(targetdir);
normalize_dirname(targetnorm);
de = dir_hash_create_dir(dh, targetdir, targetnorm);
free(targetnorm);
tf = calloc(1, sizeof(*tf));
tf->next = de->head;
de->head = tf;