On Wed, Jan 29, 2020 at 11:46:23AM +0000, Howard Chu wrote:
> on...@openldap.org wrote:
>> --- malloc_check.cocci ---
>> @@
>> expression E, E1;
>> identifier ch_alloc =~ "^(ch|slap)_.*alloc.*";
>> identifier f =~ "(?i).*alloc.*";
>> identifier foo;
>> @@
>> 
>> E =
>> (
>> ch_alloc
> 
> ch_malloc always aborts if it fails, therefore failure checks are not used.
> 
>> |
>> entry_alloc
>> |
>> attr_alloc
>> |
> 
> These rely on ch_malloc, therefore failure checks are not used.
> 
>> metaconn_alloc
>> |
>> asyncmeta_conn_alloc
>> |
>> CompAlloc /* component matching has massively bitrotted */
>> |
>> * f

Which is why only the last one is actually used - '*'.

>> )(...);
>> ... when != E = E1
>>    when != E == NULL
>>    when != E != NULL
>> (
>>  E->foo
>> |
>>  E[...]
>> |
>>  *(E)
>> )
>> --- malloc_check.cocci ---

-- 
Ondřej Kuzník
Senior Software Engineer
Symas Corporation                       http://www.symas.com
Packaged, certified, and supported LDAP solutions powered by OpenLDAP



Reply via email to