Ver código fonte

Resolves: #472999
Summary: vlv: memory leak
Description: if the addresses of the passed key and the returned key don't
match, the space for the returned key is allocated in libdb. Thus, we have to
release the returned key.

Noriko Hosoi 17 anos atrás
pai
commit
97f52d8106
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      ldap/servers/slapd/back-ldbm/vlv.c

+ 4 - 0
ldap/servers/slapd/back-ldbm/vlv.c

@@ -990,6 +990,10 @@ vlv_build_candidate_list_byvalue( struct vlvIndex* p, DBC *dbc, PRUint32 length,
         }
         LDAPDebug( LDAP_DEBUG_TRACE, "<= vlv_build_candidate_list_byvalue: Not Found. Index=%lu\n",si,0,0);
     }
+    if (key.data != typedown_value[0]->bv_val) { /* in case new key is set 
+                                                  in dbc->c_get(DB_SET_RANGE) */
+        slapi_ch_free(&(key.data));
+    }
     ber_bvecfree((struct berval**)typedown_value);
     return si;
 }