Branch: Tag:

2015-04-02

2015-04-02 14:46:17 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Windows: Fixed memory leak.

These malloc's were added in an attempt to track down a bug,
and shouldn't have been in the previous commit.

Also restores the mode bits on srs/main.c.

110: Inside #if defined(__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,
167: Inside #if defined(__NT__)
   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);