You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Justin Ross (JIRA)" <ji...@apache.org> on 2016/11/04 14:13:58 UTC

[jira] [Updated] (PROTON-727) Add a NULL-pointer checks to malloc() and realloc() calls

     [ https://issues.apache.org/jira/browse/PROTON-727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Ross updated PROTON-727:
-------------------------------
    Labels: close-pending  (was: )

> Add a NULL-pointer checks to malloc() and realloc() calls
> ---------------------------------------------------------
>
>                 Key: PROTON-727
>                 URL: https://issues.apache.org/jira/browse/PROTON-727
>             Project: Qpid Proton
>          Issue Type: Wish
>          Components: proton-c
>    Affects Versions: 0.8
>            Reporter: German Shepherd (PrE)
>            Priority: Minor
>              Labels: close-pending
>
> As we are running the ProtonC project on memory constrained systems, it is possible for malloc() or realloc() to return a NULL, when there is no more free heap to allocate the memory from.
> Obviously, we might have a specific optimizations in the ProtonC code, which deeply minimize the amount of a total heap required, but this is not what this ticket is referring to.
> In any case where there is no more free heap, or in a case where there is any other issue with the allocators, the memory allocation functions return NULL.
> The ProtonC code at this state, does not check for such a situation, and it always expects the malloc() and realloc() to work and to return a valid pointer.
> I would like the developers to add a specific test to each place, where memory allocation takes place, and to act upon an error properly (ideally - with a graceful closure of the connection to broker, if possible).
> Also, a proper signalization path to the user's application (which runs the ProtonC client) would be a great addition.
> If nothing fancy is planned, I would, at least, ask for adding the simple {{ if (x == NULL) { do something }; }} tests to each every place where memory allocation is handled.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org