Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7457

Windows memory leak in v8 wrapper

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.3.0
    • Component/s: JavaScript
    • Labels:
      None
    • Windows

      In v8_db.cpp, the GETNS macro generates an automatic variable-length array variable, except on Windows where we just allocate memory on the heap and never free it:

      #ifdef _WIN32
      #define GETNS char * ns = new char[args[0]->ToString()->Utf8Length()];  args[0]->ToString()->WriteUtf8( ns );
      #else
      #define GETNS char ns[args[0]->ToString()->Utf8Length()];  args[0]->ToString()->WriteUtf8( ns );
      #endif
      

            Assignee:
            tad Tad Marshall
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: