summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c09b65c)
raw | patch | inline | side by side (parent: c09b65c)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 15 May 2015 20:39:26 +0000 (22:39 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 15 May 2015 20:39:26 +0000 (22:39 +0200) |
src/core/store.c | patch | blob | history |
diff --git a/src/core/store.c b/src/core/store.c
index ab37e689641ec52b42f844bb5f1f1d3cd6236d63..a1cf8f6bc44b6ba816fc66ee729189c4371da07d 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
sdb_timeseries_t *ts;
+ int status = 0;
+
if ((! hostname) || (! metric) || (! opts) || (! buf))
return -1;
sdb_log(SDB_LOG_ERR, "store: Failed to fetch time-series '%s/%s' "
"- no data-store configured for the stored metric",
hostname, metric);
+ sdb_object_deref(SDB_OBJ(m));
pthread_rwlock_unlock(&host_lock);
return -1;
}
sdb_log(SDB_LOG_ERR, "store: Failed to fetch time-series '%s/%s' "
"- %s fetcher callback returned no data for '%s'",
hostname, metric, type, id);
- return -1;
+ status = -1;
}
}
ts_tojson(ts, buf);
+ sdb_object_deref(SDB_OBJ(m));
sdb_timeseries_destroy(ts);
- return 0;
+ return status;
} /* sdb_store_fetch_timeseries */
int