]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fixed missing list initialization
authorDiego Fronza <diego@isc.org>
Fri, 6 Mar 2020 19:53:20 +0000 (16:53 -0300)
committerDiego Fronza <diego@isc.org>
Fri, 6 Mar 2020 19:53:20 +0000 (16:53 -0300)
This commit fixes isc_glob function on windows environments.

The file_list_t * object pointed to by pglob->reserved was missing
ISC_LIST_INIT intialization macro.

lib/isc/glob.c

index 9803c59690dc8de2d4b1eeb58d410b4b12bfe3b6..3eb2a7ed46fc0a14843ab0bd753c4b6d8bb122c7 100644 (file)
@@ -123,7 +123,7 @@ static int
 glob(const char *pattern, int flags, void *unused, glob_t *pglob) {
        char path[MAX_PATH];
        WIN32_FIND_DATAA find_data;
-       ;
+       int ec;
        HANDLE hnd;
 
        REQUIRE(pattern != NULL);
@@ -159,6 +159,7 @@ glob(const char *pattern, int flags, void *unused, glob_t *pglob) {
 
        isc_mem_create(&pglob->mctx);
        pglob->reserved = isc_mem_get(pglob->mctx, sizeof(file_list_t));
+       ISC_LIST_INIT(*(file_list_t *)pglob->reserved);
 
        size_t entries = 0;
 
@@ -198,7 +199,7 @@ glob(const char *pattern, int flags, void *unused, glob_t *pglob) {
        return (0);
 
 fail:
-       int ec = errno;
+       ec = errno;
 
        FindClose(hnd);