Em 12-04-2014 11:30, Ken Goldman escreveu:
> Probably too late for this code, but multiple returns are the source of
> many of these bugs.  If you code:
>
>       ptr = NULL;
>       function execution that may or may not malloc the ptr;
>       free(ptr);
>       return;
>
> you'll never have missing or double frees, or freeing an uninitialized
> pointer.

When I create code I always favor using a label under which all clean up 
code is concentrated. Unfortunately, not all code in TrouSerS can be 
changed to use this model without a major rewrite.

> On 4/11/2014 5:51 AM, Fuchs, Andreas wrote:
>
>> The patch is not correct. The free may only be performed in case of
>> result == TSS2_SUCCESS. The current version has a potential
>> double-free. In case of error, RPC_ExecuteTransport_TP will falsely
>> free this memory.
>> ...
>>
>> This is going to be a major rewrite I fear...
>
>
> ------------------------------------------------------------------------------
> Put Bad Developers to Shame
> Dominate Development with Jenkins Continuous Integration
> Continuously Automate Build, Test & Deployment
> Start a new project now. Try Jenkins in the cloud.
> http://p.sf.net/sfu/13600_Cloudbees
> _______________________________________________
> TrouSerS-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/trousers-tech
>


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech

Reply via email to