A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Plug a memleak when using gras_dynar_cursor_rm
[simgrid.git]
/
src
/
xbt
/
dynar.c
diff --git
a/src/xbt/dynar.c
b/src/xbt/dynar.c
index
16a5f00
..
b039d34
100644
(file)
--- a/
src/xbt/dynar.c
+++ b/
src/xbt/dynar.c
@@
-546,10
+546,13
@@
gras_dynar_cursor_get(const gras_dynar_t * const dynar,
* @dynar:
* @cursor:
*
* @dynar:
* @cursor:
*
- * Remove the entry pointed by the cursor, for use in the middle of a foreach
+ * Remove
(free)
the entry pointed by the cursor, for use in the middle of a foreach
*/
void gras_dynar_cursor_rm(gras_dynar_t * dynar,
int * const cursor) {
*/
void gras_dynar_cursor_rm(gras_dynar_t * dynar,
int * const cursor) {
-
- gras_dynar_remove_at(dynar,(*cursor)--,NULL);
+ void *dst;
+
+ gras_dynar_remove_at(dynar,(*cursor)--,&dst);
+ if (dynar->free)
+ (dynar->free)(dst);
}
}