]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7557 fix crash when doing 'limit_usage mongo foo bar'
authorChris Rienzo <chris.rienzo@grasshopper.com>
Fri, 15 May 2015 12:43:00 +0000 (08:43 -0400)
committerChris Rienzo <chris.rienzo@grasshopper.com>
Fri, 15 May 2015 12:43:00 +0000 (08:43 -0400)
src/mod/applications/mod_mongo/mod_mongo.c

index a14958dab61609422a06d19e99b9f2751993e281..a614d1f79a786275556454430059d48ea757e143 100644 (file)
@@ -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) {