Skip to content

Commit 0d5f7ce

Browse files
committed
Fix for crypt memory leak, from James Thompson
1 parent 7c8beef commit 0d5f7ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/libpq/crypt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Dec 17, 1997 - Todd A. Brandys
1010
* Orignal Version Completed.
1111
*
12-
* $Id: crypt.c,v 1.17 1999/05/25 16:08:58 momjian Exp $
12+
* $Id: crypt.c,v 1.18 1999/05/27 04:09:45 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -147,8 +147,8 @@ crypt_loadpwdfile()
147147
{ /* free the old data only if this is a
148148
* reload */
149149
while (pwd_cache_count--)
150-
pfree((void *) pwd_cache[pwd_cache_count]);
151-
pfree((void *) pwd_cache);
150+
free((void *) pwd_cache[pwd_cache_count]);
151+
free((void *) pwd_cache);
152152
pwd_cache = NULL;
153153
pwd_cache_count = 0;
154154
}
@@ -170,7 +170,7 @@ crypt_loadpwdfile()
170170
buffer[result] = '\0';
171171

172172
pwd_cache = (char **) realloc((void *) pwd_cache, sizeof(char *) * (pwd_cache_count + 1));
173-
pwd_cache[pwd_cache_count++] = pstrdup(buffer);
173+
pwd_cache[pwd_cache_count++] = strdup(buffer);
174174
}
175175
FreeFile(pwd_file);
176176

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy