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 years ago
parent
commit
ba92e52879
1 changed files with 2 additions and 0 deletions
  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;