Switch to side-by-side view

--- a/src/execmd.cpp
+++ b/src/execmd.cpp
@@ -21,8 +21,6 @@
 #include "config.h"
 #endif
 
-#include <map>
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -38,6 +36,7 @@
 #include <time.h>
 #include <string.h>
 
+#include <map>
 #include <vector>
 #include <string>
 #include <stdexcept>
@@ -301,15 +300,18 @@
         m_parent->reset();
     }
 private:
-    ExecCmd::Internal *m_parent;
-    bool    m_active;
+    ExecCmd::Internal *m_parent{nullptr};
+    bool    m_active{false};
 };
 
 ExecCmd::~ExecCmd()
 {
-    ExecCmdRsrc(this->m);
+    if (m) {
+        ExecCmdRsrc r(m);
+    }
     if (m) {
         delete m;
+        m = nullptr;
     }
 }
 
@@ -458,7 +460,7 @@
     }
 
     // The resource manager ensures resources are freed if we return early
-    ExecCmdRsrc e(this->m);
+    ExecCmdRsrc e(m);
 
     if (has_input && pipe(m->m_pipein) < 0) {
         LOGERR("ExecCmd::startExec: pipe(2) failed. errno " << errno << "\n" );
@@ -769,7 +771,7 @@
     }
 
     // Cleanup in case we return early
-    ExecCmdRsrc e(this->m);
+    ExecCmdRsrc e(m);
     SelectLoop myloop;
     int ret = 0;
     if (input || output) {
@@ -971,7 +973,7 @@
 // overhead.
 int ExecCmd::wait()
 {
-    ExecCmdRsrc e(this->m);
+    ExecCmdRsrc e(m);
     int status = -1;
     if (!m->m_killRequest && m->m_pid > 0) {
         if (waitpid(m->m_pid, &status, 0) < 0) {
@@ -987,7 +989,7 @@
 
 bool ExecCmd::maybereap(int *status)
 {
-    ExecCmdRsrc e(this->m);
+    ExecCmdRsrc e(m);
     *status = -1;
 
     if (m->m_pid <= 0) {