diff options
Diffstat (limited to 'src/sql.c')
-rw-r--r-- | src/sql.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -27,13 +27,13 @@ struct sql_list | |||
27 | static struct sql_list *sql_list; | 27 | static struct sql_list *sql_list; |
28 | 28 | ||
29 | /* Append CONN to the end of sql_list */ | 29 | /* Append CONN to the end of sql_list */ |
30 | void | 30 | void |
31 | sql_register_conn (struct sqlconn *conn) | 31 | sql_register_conn (struct sqlconn *conn) |
32 | { | 32 | { |
33 | struct sql_list *ent = xmalloc (sizeof *ent); | 33 | struct sql_list *ent = grecs_malloc (sizeof *ent); |
34 | ent->conn = *conn; | 34 | ent->conn = *conn; |
35 | ent->next = sql_list; | 35 | ent->next = sql_list; |
36 | sql_list = ent; | 36 | sql_list = ent; |
37 | } | 37 | } |
38 | 38 | ||
39 | /* Find a configured connection that has the given IDENT */ | 39 | /* Find a configured connection that has the given IDENT */ |
@@ -195,13 +195,13 @@ sql_quote (struct dictionary *dict, void *handle, const char *input, | |||
195 | struct sqlconn *conn = handle; | 195 | struct sqlconn *conn = handle; |
196 | size_t len, size; | 196 | size_t len, size; |
197 | char *output; | 197 | char *output; |
198 | 198 | ||
199 | len = strlen (input); | 199 | len = strlen (input); |
200 | size = 2 * len + 1; | 200 | size = 2 * len + 1; |
201 | output = xmalloc (size); | 201 | output = grecs_malloc (size); |
202 | mysql_real_escape_string (&conn->mysql, output, input, len); | 202 | mysql_real_escape_string (&conn->mysql, output, input, len); |
203 | *poutput = output; | 203 | *poutput = output; |
204 | if (psize) | 204 | if (psize) |
205 | *psize = strlen (output); | 205 | *psize = strlen (output); |
206 | return 0; | 206 | return 0; |
207 | } | 207 | } |