Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-1354

Resource leak in jvm.cpp

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.20.0
    • Component/s: None
    • Labels:

      Description

      Again, may be false positive. Should be looked into.
      ________________________________________________________________________________________________________

          • CID 1213891: Resource leak (RESOURCE_LEAK)
            /src/jvm/jvm.cpp: 79 in Jvm::create(const std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>> &, JNI::Version, bool)()
            73 typedef jint (fnptr_JNI_CreateJavaVM)(JavaVM, void, void);
            74
            75 fnptr_JNI_CreateJavaVM fn_JNI_CreateJavaVM =
            76 (fnptr_JNI_CreateJavaVM)dlsym(handle, "JNI_CreateJavaVM");
            77
            78 if (fn_JNI_CreateJavaVM == NULL) { >>> CID 1213891: Resource leak (RESOURCE_LEAK) >>> Variable "handle" going out of scope leaks the storage it points to. 79 return Error(dlerror()); 80 }

            81
            82 int result = fn_JNI_CreateJavaVM(&jvm, JNIENV_CAST(&env), &vmArgs);
            83
            84 if (result == JNI_ERR)

            { /src/jvm/jvm.cpp: 85 in Jvm::create(const std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>> &, JNI::Version, bool)() 79 return Error(dlerror()); 80 }

            81
            82 int result = fn_JNI_CreateJavaVM(&jvm, JNIENV_CAST(&env), &vmArgs);
            83
            84 if (result == JNI_ERR)

            { >>> CID 1213891: Resource leak (RESOURCE_LEAK) >>> Variable "handle" going out of scope leaks the storage it points to. 85 return Error("Failed to create JVM!"); 86 }

            87
            88 delete[] opts;
            89
            90 return instance = new Jvm(jvm, version, exceptions);
            /src/jvm/jvm.cpp: 90 in Jvm::create(const std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char>>>> &, JNI::Version, bool)()
            84 if (result == JNI_ERR)

            { 85 return Error("Failed to create JVM!"); 86 }

            87
            88 delete[] opts;
            89
            >>> CID 1213891: Resource leak (RESOURCE_LEAK)
            >>> Variable "handle" going out of scope leaks the storage it points to.
            90 return instance = new Jvm(jvm, version, exceptions);
            91 }
            92
            93
            94 bool Jvm::created()
            95 {

        Attachments

          Activity

            People

            • Assignee:
              tstclair Timothy St. Clair
              Reporter:
              nnielsen Niklas Quarfot Nielsen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: