pike.git / src / main.c

version» Context lines:

pike.git/src/main.c:105:   #define strdup _strdup   #endif /* __NT__ */   #endif /* DEBUG_MALLOC */    master_file_location = strdup( file );   }      #ifdef __NT__   static void get_master_key(HKEY cat)   {    HKEY k; -  char * buffer = malloc(4096); +  char buffer[4096];    DWORD len=sizeof(buffer)-1,type=REG_SZ;       if(RegOpenKeyEx(cat,    (LPCTSTR)("SOFTWARE\\Pike\\"    DEFINETOSTR(PIKE_MAJOR_VERSION)    "."    DEFINETOSTR(PIKE_MINOR_VERSION)    "."    DEFINETOSTR(PIKE_BUILD_VERSION)),    0,KEY_READ,&k)==ERROR_SUCCESS)
pike.git/src/main.c:162:    set_master( tmp );    }      #ifdef __NT__    if (!(*mp == '/' || *mp == '\\' || (isalpha (*mp) && mp[1] == ':'))) {    char exepath[MAXPATHLEN];    if (!GetModuleFileName (NULL, exepath, _MAX_PATH))    fprintf (stderr, "Failed to get path to exe file: %d\n",    GetLastError());    else { -  char * tmp = malloc(MAXPATHLEN * 2); +  char tmp[MAXPATHLEN * 2];    char *p = strrchr (exepath, '\\');    if (p) *p = 0;    SNPRINTF (tmp, sizeof (tmp), "%s/%s", exepath, mp);    set_master( tmp );    }    }   #else    if (!*mp) {    /* Attempt to find a master via the path to the binary. */    /* Note: We assume that MAXPATHLEN is > 18 characters. */