1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-09 02:33:11 +01:00
git/path-list.h
René Scharfe 79d722224d path-list.c: always free strdup'ed paths
Always free .paths if .strdup_paths is set, no matter if the
parameter free_items is set or not, plugging a minor memory leak.
And to clarify the meaning of the flag, rename it to free_util,
since it now only affects the freeing of the .util field.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-15 13:43:08 -07:00

22 lines
596 B
C

#ifndef PATH_LIST_H
#define PATH_LIST_H
struct path_list_item {
char *path;
void *util;
};
struct path_list
{
struct path_list_item *items;
unsigned int nr, alloc;
unsigned int strdup_paths:1;
};
void print_path_list(const char *text, const struct path_list *p);
int path_list_has_path(const struct path_list *list, const char *path);
void path_list_clear(struct path_list *list, int free_util);
struct path_list_item *path_list_insert(const char *path, struct path_list *list);
struct path_list_item *path_list_lookup(const char *path, struct path_list *list);
#endif /* PATH_LIST_H */