summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1a82248)
raw | patch | inline | side by side (parent: 1a82248)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 31 Mar 2014 23:10:47 +0000 (01:10 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 31 Mar 2014 23:10:47 +0000 (01:10 +0200) |
This is basically the same as 2f392819, which got applied to the
curl_xml plugin a few months ago.
Fixes #582.
curl_xml plugin a few months ago.
Fixes #582.
src/curl_json.c | patch | blob | history |
diff --git a/src/curl_json.c b/src/curl_json.c
index 1ef8a26285a8375f5af8545e0d5e7abea60ca50d..42a3a10c8f3d3174d29acd095b2d7ab18d7c317c 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
if (status == 0)
{
user_data_t ud;
- char cb_name[DATA_MAX_NAME_LEN];
+ char *cb_name;
if (db->instance == NULL)
db->instance = strdup("default");
ud.data = (void *) db;
ud.free_func = cj_free;
- ssnprintf (cb_name, sizeof (cb_name), "curl_json-%s-%s",
+ cb_name = ssnprintf_alloc ("curl_json-%s-%s",
db->instance, db->url ? db->url : db->sock);
- plugin_register_complex_read (/* group = */ NULL, cb_name, cj_read,
+ plugin_register_complex_read (/* group = */ "curl_json", cb_name, cj_read,
/* interval = */ NULL, &ud);
+ sfree (cb_name);
}
else
{