From 9f2a06a80ea16f5e75bb79bb3f90e712f7c1d3e2 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 13 Sep 2013 21:45:54 -0400 Subject: [PATCH] Windows: Construct paths for LoadLibrary with backslashes Mixing forward and backslashes is confusing. Use the expected backslashes. Change-Id: Ia775c73eca430138f677decc1975aad0a401fc53 --- lib/krb5/plugin.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/krb5/plugin.c b/lib/krb5/plugin.c index 0521971b5..74889406e 100644 --- a/lib/krb5/plugin.c +++ b/lib/krb5/plugin.c @@ -328,6 +328,7 @@ _krb5_load_plugins(krb5_context context, const char *name, const char **paths) if (n[0] == '.' && (n[1] == '\0' || (n[1] == '.' && n[2] == '\0'))) continue; + ret = 0; #ifdef _WIN32 /* * On Windows, plugins must be loaded from the same directory as @@ -342,10 +343,12 @@ _krb5_load_plugins(krb5_context context, const char *name, const char **paths) ext = strrchr(n, '.'); if (ext == NULL || stricmp(ext, ".dll")) continue; + + ret = asprintf(&path, "%s\\%s", dirname, n); + if (ret < 0 || path == NULL) + continue; } #endif - - ret = 0; #ifdef __APPLE__ { /* support loading bundles on MacOS */ size_t len = strlen(n); -- 2.11.4.GIT