Skip to content

Commit

Permalink
Fix a leak in store_sos.c
Browse files Browse the repository at this point in the history
  • Loading branch information
nichamon authored and tom95858 committed Jul 16, 2024
1 parent d986eaf commit ea8e8e4
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions ldms/src/store/store_sos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,10 +1322,7 @@ store(ldmsd_store_handle_t _sh, ldms_set_t set,
int *metric_arry, size_t metric_count)
{
struct sos_instance *si = _sh;
struct ldms_timestamp timestamp;
struct timespec now;
SOS_VALUE(value);
sos_obj_t obj;
int rc = 0;

if (!si)
Expand Down Expand Up @@ -1378,24 +1375,6 @@ store(ldmsd_store_handle_t _sh, ldms_set_t set,
} else {
sos_begin_x(si->sos_handle->sos);
}
obj = sos_obj_new(si->sos_schema);
if (!obj) {
LOG_(LDMSD_LERROR, "Error %d: %s at %s:%d\n", errno,
STRERROR(errno), __FILE__, __LINE__);
errno = ENOMEM;
goto err;
}
timestamp = ldms_transaction_timestamp_get(set);

/* timestamp */
if (NULL == sos_value_init(value, obj, si->ts_attr)) {
LOG_(LDMSD_LERROR, "Error initializing timestamp attribute\n");
errno = ENOMEM;
goto err;
}
value->data->prim.timestamp_.fine.secs = timestamp.sec;
value->data->prim.timestamp_.fine.usecs = timestamp.usec;
sos_value_put(value);

switch (si->mode) {
case STORE_SOS_M_BASIC:
Expand Down

0 comments on commit ea8e8e4

Please sign in to comment.