Skip to content
Snippets Groups Projects
  • Kevin P. Fleming's avatar
    e4dafd3d
    Ensure that accidental calls to ast_string_field_free_memory() on embedded... · e4dafd3d
    Kevin P. Fleming authored
    Ensure that accidental calls to ast_string_field_free_memory() on embedded stringfield pools are safe.
    
    It is possible for a stringfield manager structure (and pool) structure to be allocated
    as part of a larger structure allocation (using ast_calloc_with_strinfields()); when
    this is done, the stringfield pool cannot be separately freed, but users of the tructure
    may not be aware (and shouldn't have to be aware) of whether the pool was embedded.
    This patch modifies the behavior so that they can always call ast_string_field_free_memory()
    and the function will do the right thing for both embedded and non-embedded situations.
    
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
    e4dafd3d
    History
    Ensure that accidental calls to ast_string_field_free_memory() on embedded...
    Kevin P. Fleming authored
    Ensure that accidental calls to ast_string_field_free_memory() on embedded stringfield pools are safe.
    
    It is possible for a stringfield manager structure (and pool) structure to be allocated
    as part of a larger structure allocation (using ast_calloc_with_strinfields()); when
    this is done, the stringfield pool cannot be separately freed, but users of the tructure
    may not be aware (and shouldn't have to be aware) of whether the pool was embedded.
    This patch modifies the behavior so that they can always call ast_string_field_free_memory()
    and the function will do the right thing for both embedded and non-embedded situations.
    
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197775 65c4cc65-6c06-0410-ace0-fbb531ad65f3