commit f072461

grunfink  ·  2026-10-02 07:12:21 +0000 UTC
parent 31318c5
Fixed memory leaks and warnings in previous patch.
1 files changed,  +3, -3
M data.c
M data.c
+3, -3
 1@@ -3493,13 +3493,13 @@ xs_dict *markers_get(snac *snac, const xs_list *markers)
 2     xs_list_foreach(markers, v) {
 3         const xs_dict *mark = xs_dict_get(data, v);
 4         if (!xs_is_null(mark)) {
 5-            xs_dict *copy = xs_dup(mark);
 6+            xs *copy = xs_dup(mark);
 7             const xs_val *datetime = xs_dict_get(mark, "updated_at");
 8             if (!xs_is_null(datetime) && datetime[0] != '2') {
 9                 /* fix wrong timestamp format */
10                 struct timeval tv;
11-                if (sscanf(datetime, "%lu.%lu", &(tv.tv_sec), &(tv.tv_usec))==2)
12-                    xs_dict_set(copy, "updated_at", rfctime(0, &tv));
13+                if (sscanf(datetime, "%lu.%lu", (unsigned long *)&(tv.tv_sec), (unsigned long *)&(tv.tv_usec))==2)
14+                    copy = xs_dict_set(copy, "updated_at", rfctime(0, &tv));
15             }
16             returns = xs_dict_append(returns, v, copy);
17         }