- Timestamp:
- 2023-04-01T20:29:42Z (21 months ago)
- Branches:
- master
- Children:
- 10425b2
- Parents:
- a4ac9c4
- git-author:
- David Cantrell <dcantrell@…> (01-04-23 20:29:42)
- git-committer:
- GitHub <noreply@…> (01-04-23 20:29:42)
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/http_client.c
ra4ac9c4 r552da22 372 372 if (chunk != req->cbuf) { 373 373 req->cblen = eos - chunk; 374 s = g_memdup (chunk, req->cblen + 1);374 s = g_memdup2(chunk, req->cblen + 1); 375 375 g_free(req->cbuf); 376 376 req->cbuf = s; … … 462 462 /* Separately allocated space for headers and body. */ 463 463 req->sblen = req->body_size = req->reply_headers + req->bytes_read - req->reply_body; 464 req->sbuf = req->reply_body = g_memdup (req->reply_body, req->body_size + 1);464 req->sbuf = req->reply_body = g_memdup2(req->reply_body, req->body_size + 1); 465 465 req->reply_headers = g_realloc(req->reply_headers, end1 - req->reply_headers + 1); 466 466 … … 680 680 681 681 if (req->reply_body - req->sbuf >= 512) { 682 char *new = g_memdup (req->reply_body, req->body_size + 1);682 char *new = g_memdup2(req->reply_body, req->body_size + 1); 683 683 g_free(req->sbuf); 684 684 req->reply_body = req->sbuf = new; -
lib/json_util.c
ra4ac9c4 r552da22 27 27 28 28 #include "json_util.h" 29 30 /* g_memdup() deprecated as of glib 2.68.0 */ 31 #ifdef GLIB_VERSION_2_68 32 #define g_memdup2 g_memdup2 33 #else 34 #define g_memdup2 g_memdup 35 #endif 29 36 30 37 json_value *json_o_get(const json_value *obj, const json_char *name) … … 61 68 62 69 if (ret && ret->type == json_string && ret->u.string.ptr) { 63 return g_memdup (ret->u.string.ptr, ret->u.string.length + 1);70 return g_memdup2(ret->u.string.ptr, ret->u.string.length + 1); 64 71 } else { 65 72 return NULL; -
lib/xmltree.c
ra4ac9c4 r552da22 33 33 #define g_strncasecmp g_ascii_strncasecmp 34 34 35 /* g_memdup() deprecated as of glib 2.68.0 */ 36 #ifdef GLIB_VERSION_2_68 37 #define g_memdup2 g_memdup2 38 #else 39 #define g_memdup2 g_memdup 40 #endif 41 35 42 static void xt_start_element(GMarkupParseContext *ctx, const gchar *element_name, const gchar **attr_names, 36 43 const gchar **attr_values, gpointer data, GError **error) … … 364 371 dup->flags = node->flags; 365 372 if (node->text) { 366 dup->text = g_memdup (node->text, node->text_len + 1);373 dup->text = g_memdup2(node->text, node->text_len + 1); 367 374 dup->text_len = node->text_len; 368 375 }
Note: See TracChangeset
for help on using the changeset viewer.