Răsfoiți Sursa

fix coverity resource leak in windows_plugin_add

13056 Resource leak
In windows_plugin_add(): Leak of memory or pointers to system resources (CWE-404)
Rich Megginson 13 ani în urmă
părinte
comite
ba92e52879
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      ldap/servers/plugins/replication/windows_private.c

+ 2 - 0
ldap/servers/plugins/replication/windows_private.c

@@ -1251,6 +1251,8 @@ windows_plugin_add(void **theapi, int maxapi)
             PR_INSERT_BEFORE(wpi, elem);
             wpi = NULL; /* owned by list now */
         }
+        /* if we got here and wpi is not NULL we need to free wpi */
+        slapi_ch_free((void **)&wpi);
         return 0;
     }
     return -1;