Browse Source

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 năm trước cách đây
mục cha
commit
ba92e52879
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  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;