[cairo] Consistent state during error recovery

Mike Owens etc at filespanker.com
Mon Feb 14 06:55:38 PST 2005


Greetings Cairo hackers,

I hit a case where an object was left in an inconsistent state following an 
OOM error path.  Attached is a patch which fixes it, and a several very 
similar situations I found in the code base, among which are some 
decent-sized memory leaks.

I've tested these changes, but the conditions are hard to trigger and test, so 
I suggest an exhaustive review before commit.

As a side note, it would be nice to codify and document the side effects 
various cairo functions have on their arguments in the case of returning an 
error, especially functions which append an item to a list, etc.

(And kudos for the text-book quality C, it was amazingly easy to review.)

Regards,

Mike Owens
http://mike.filespanker.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: consistent_recovery.patch
Type: text/x-diff
Size: 4216 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050214/a6fb4598/consistent_recovery.bin


More information about the cairo mailing list