X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinshare.c;h=5f1c7244010ff401a4da4889c674b349884654b0;hb=21101c7397e460933635a7bfed813864fc4f88fe;hp=89c1cc32591d57160c11e489ade7880a9433be06;hpb=566405ae68bc3358647d47ea00c5a7891f190933;p=PuTTY.git diff --git a/windows/winshare.c b/windows/winshare.c index 89c1cc32..5f1c7244 100644 --- a/windows/winshare.c +++ b/windows/winshare.c @@ -14,7 +14,23 @@ #include "proxy.h" #include "ssh.h" -#include "winsecur.h" +#include "wincapi.h" + +#ifdef COVERITY +/* + * The hack I use to build for Coverity scanning, using winegcc and + * Makefile.cyg, didn't provide some defines in wincrypt.h last time I + * looked. Therefore, define them myself here, but enclosed in #ifdef + * COVERITY to ensure I don't make up random nonsense values for any + * real build. + */ +#ifndef CRYPTPROTECTMEMORY_BLOCK_SIZE +#define CRYPTPROTECTMEMORY_BLOCK_SIZE 16 +#endif +#ifndef CRYPTPROTECTMEMORY_CROSS_PROCESS +#define CRYPTPROTECTMEMORY_CROSS_PROCESS 1 +#endif +#endif #define CONNSHARE_PIPE_PREFIX "\\\\.\\pipe\\putty-connshare" #define CONNSHARE_MUTEX_PREFIX "Local\\putty-connshare-mutex" @@ -141,6 +157,7 @@ int platform_ssh_share(const char *pi_name, Conf *conf, if (!make_private_security_descriptor(MUTEX_ALL_ACCESS, &psd, &acl, logtext)) { sfree(mutexname); + sfree(name); return SHARE_NONE; } @@ -155,6 +172,7 @@ int platform_ssh_share(const char *pi_name, Conf *conf, *logtext = dupprintf("CreateMutex(\"%s\") failed: %s", mutexname, win_strerror(GetLastError())); sfree(mutexname); + sfree(name); LocalFree(psd); LocalFree(acl); return SHARE_NONE;