We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4056efc commit 3772975Copy full SHA for 3772975
src/port/strdup.c
@@ -8,7 +8,7 @@
8
*
9
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/port/strdup.c,v 1.7 2005/07/28 04:03:14 tgl Exp $
+ * $PostgreSQL: pgsql/src/port/strdup.c,v 1.8 2005/09/27 04:53:23 tgl Exp $
12
13
*-------------------------------------------------------------------------
14
*/
@@ -19,10 +19,12 @@
19
20
21
char *
22
-strdup(char const * string)
+strdup(const char *string)
23
{
24
char *nstr;
25
26
- nstr = strcpy((char *) malloc(strlen(string) + 1), string);
+ nstr = (char *) malloc(strlen(string) + 1);
27
+ if (nstr)
28
+ strcpy(nstr, string);
29
return nstr;
30
}
0 commit comments