Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1406

scan-build warnings (mongoc)

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0
    • Affects Version/s: 1.4.0
    • Component/s: None
    • Labels:
      None

      [2016/07/19 18:43:06.482] src/mongoc/mongoc-async.c:126:26: warning: Access to field 'expire_at' results in a dereference of a null pointer (loaded from field 'cmds')
       [2016/07/19 18:43:06.482]          timeout_msec = (async->cmds->expire_at - now) / 1000;
       [2016/07/19 18:43:06.482]                          ^~~~~~~~~~~~~~~~~~~~~~
       [2016/07/19 18:43:06.482] 1 warning generated.
      
       [2016/07/19 18:43:02.121] examples/bson-streaming-reader.c:173:14: warning: Potential leak of memory pointed to by 'hostname'
       [2016/07/19 18:43:02.121]       return EXIT_FAILURE;
       [2016/07/19 18:43:02.121]              ^~~~~~~~~~~~
       [2016/07/19 18:43:02.121] /usr/include/stdlib.h:133:22: note: expanded from macro 'EXIT_FAILURE'
       [2016/07/19 18:43:02.121] #define EXIT_FAILURE    1       /* Failing exit status.  */
       [2016/07/19 18:43:02.121]                         ^
       [2016/07/19 18:43:02.121] examples/bson-streaming-reader.c:173:14: warning: Potential leak of memory pointed to by 'port'
       [2016/07/19 18:43:02.121]       return EXIT_FAILURE;
       [2016/07/19 18:43:02.121]              ^~~~~~~~~~~~
       [2016/07/19 18:43:02.121] /usr/include/stdlib.h:133:22: note: expanded from macro 'EXIT_FAILURE'
       [2016/07/19 18:43:02.121] #define EXIT_FAILURE    1       /* Failing exit status.  */
       [2016/07/19 18:43:02.121]                         ^
       [2016/07/19 18:43:02.121] 2 warnings generated.
      
       [2016/07/19 18:43:37.413] src/mongoc/mongoc-gridfs-file.c:836:17: warning: Function call argument is an uninitialized value
       [2016/07/19 18:43:37.413]    file->page = _mongoc_gridfs_file_page_new (data, len, file->chunk_size);
       [2016/07/19 18:43:37.413]                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       [2016/07/19 18:43:37.413] 1 warning generated.
      
       [2016/07/19 18:44:37.844] src/mongoc/mongoc-openssl.c:319:13: warning: Value stored to 'idx' is never read
       [2016/07/19 18:44:37.844]             idx = -1;
       [2016/07/19 18:44:37.844]             ^     ~~
       [2016/07/19 18:44:37.844] 1 warning generated.
      
       [2016/07/19 18:46:35.956] tests/mock_server/mock-server.c:1258:7: warning: Value stored to 'r' is never read
       [2016/07/19 18:46:35.956]       r = bson_init_from_json (&doc, "{}", -1, &error);
       [2016/07/19 18:46:35.956]       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       [2016/07/19 18:46:35.956] 1 warning generated.
      
       [2016/07/19 18:46:53.397] tests/test-mongoc-metadata.c:75:4: warning: Value stored to 'pool' is never read
       [2016/07/19 18:46:53.397]    pool = mongoc_client_pool_new (uri);
       [2016/07/19 18:46:53.397]    ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       [2016/07/19 18:46:53.397] 1 warning generated.
      

      See https://s3.amazonaws.com/mciuploads/mongo-c-driver/clang38/f952591a1aaecd0a554521900ed183fae14db8e3/578ec27d3ff1221c8e00146a/mongo_c_driver_clang38_f952591a1aaecd0a554521900ed183fae14db8e3_16_07_20_00_16_28/artifacts/scan.tar.gz for html generated reports

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: