Commits

Brian Curtin committed edcf653

Check FreeLibrary return value.

Comments (0)

Files changed (1)

 static PyObject *
 mdmp_enable(PyObject *self, PyObject *args, PyObject *kwargs)
 {
-    DWORD rv;
     Py_UNICODE *pyname = L"python";
     Py_UNICODE *pydir = L"";
     int type = MiniDumpNormal;
         SetUnhandledExceptionFilter(previous_filter);
 
     if (DbgHelp != NULL) {
-        FreeLibrary(DbgHelp);
+        if (FreeLibrary(DbgHelp) == 0) {
+            PyErr_SetString(PyExc_RuntimeError,
+                            "Unable to unload DbgHelp.dll");
+            return NULL;
+        }
         DbgHelp = NULL;
     }
 
+    dump_details.app_name = NULL;
+    dump_details.dir = NULL;
+
     Py_RETURN_NONE;
 }