#866 closed defect (fixed)
Semantic of free() and G_free() for G_free_key_value()
Reported by: | mloskot | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | LibGIS | Version: | svn-trunk |
Keywords: | gdal | Cc: | |
CPU: | Unspecified | Platform: | All |
Description
Recently, a bug has been submitted to QGIS and forwarded to GDAL.
IMHO, the problem is in GRASS.
The function is G_free_key_value not proof against nullptr and, given purpose of this function, if pointer to key is null, it should do nothing. This is a standard semantic of free() function in C library. Moreover, G_free function already follows semantic of free(), so G_free_key_value() should do it as well.
In other words, it should read as follows:
void G_free_key_value(struct Key_Value *kv) { if (kv != NULL) { } }
Change History (5)
follow-up: 2 comment:1 by , 15 years ago
follow-up: 3 comment:2 by , 15 years ago
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Replying to mloskot:
Fixed in r40399 (trunk).