inode cache: ensure we never use an unitilized struct stat

feature/tap-sh
Baptiste Daroussin 2017-01-07 17:52:44 +01:00
parent e9b4c2c789
commit 2e855972dc
1 changed files with 4 additions and 2 deletions

View File

@ -89,8 +89,10 @@ pkgconf_path_add(const char *text, pkgconf_list_t *dirlist, bool filter)
node = calloc(sizeof(pkgconf_path_t), 1);
node->path = strdup(text);
#ifdef PKGCONF_CACHE_INODES
node->handle_path = (void *)(intptr_t) st.st_ino;
node->handle_device = (void *)(intptr_t) st.st_dev;
if (filter) {
node->handle_path = (void *)(intptr_t) st.st_ino;
node->handle_device = (void *)(intptr_t) st.st_dev;
}
#endif
pkgconf_node_insert_tail(&node->lnode, node, dirlist);