Details

[Home]

Issue of the Standard # D0011

Brief

The documentation of the interface "g_realloc" is incomplete

Detailed Description

Documentation does not mention that in case when "n_bytes" is 0 the memory passed is get freed.

Problem location(s) in the standard

Linux Standard Base Desktop Specification 3.1, Chapter 12. Libraries, 12.2 Interfaces for libglib-2.0; http://www.gtk.org/api/2.6/glib/glib-Memory-Allocation.html#g-realloc

Possible solutions

Change the sentence:

n_bytes may be 0, in which case NULL will be returned.

to the following:

n_bytes may be 0, in which case NULL will be returned and if mem is not NULL it will be freed.

Accepted

Gnome Bugzilla 491969

Status

Fixed in gtk-glib - 2.16

[Home]