aboutsummaryrefslogtreecommitdiff
path: root/src/sql.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql.c')
-rw-r--r--src/sql.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sql.c b/src/sql.c
index a4b311e..80eb344 100644
--- a/src/sql.c
+++ b/src/sql.c
@@ -27,13 +27,13 @@ struct sql_list
27static struct sql_list *sql_list; 27static 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 */
30void 30void
31sql_register_conn (struct sqlconn *conn) 31sql_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}

Return to:

Send suggestions and report system problems to the System administrator.