提交 25f2f18c authored 作者: Chris Rienzo's avatar Chris Rienzo

FS-7557 fix crash when doing 'limit_usage mongo foo bar'

上级 13513439
......@@ -496,7 +496,7 @@ static switch_status_t mod_mongo_get_usage(const char *resource, int *usage)
mongoc_collection_t *col = mongoc_client_get_collection(conn, globals.limit_database, globals.limit_collection);
if (col) {
bson_t *query = BCON_NEW("_id", resource);
bson_t *fields = BCON_NEW("{", "total", BCON_INT32(1), "}");
bson_t *fields = BCON_NEW("total", BCON_INT32(1));
bson_error_t error;
mongoc_cursor_t *cursor = mongoc_collection_find(col, 0, 0, 1, 0, query, fields, NULL);
if (cursor) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论