Explorar o código

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 %!s(int64=13) %!d(string=hai) anos
pai
achega
ba92e52879
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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;