projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20a47e9
)
Fix const free warnings
author
Arran Cudbard-Bell
<a.cudbardb@freeradius.org>
Sat, 23 Feb 2013 01:22:51 +0000
(20:22 -0500)
committer
Arran Cudbard-Bell
<a.cudbardb@freeradius.org>
Sat, 23 Feb 2013 03:04:59 +0000
(22:04 -0500)
scripts/jlibtool.c
patch
|
blob
|
history
diff --git
a/scripts/jlibtool.c
b/scripts/jlibtool.c
index
cdad9b5
..
08b46c3
100644
(file)
--- a/
scripts/jlibtool.c
+++ b/
scripts/jlibtool.c
@@
-414,6
+414,14
@@
static void *lt_malloc(size_t size)
return out;
}
+static void lt_const_free(const void *ptr)
+{
+ void *tmp;
+
+ memcpy(&tmp, &ptr, sizeof(tmp));
+ free(tmp);
+}
+
static void init_count_chars(count_chars *cc)
{
cc->vals = (const char**) lt_malloc(PATH_MAX*sizeof(char*));
@@
-1307,7
+1315,7
@@
static void add_rpath_file(count_chars *cc, const char *arg)
path = load_install_path(arg);
if (path) {
add_rpath(cc, path);
- free(path);
+
lt_const_
free(path);
}
}
@@
-1318,7
+1326,7
@@
static void add_rpath_noinstall(count_chars *cc, const char *arg, int pathlen)
path = load_noinstall_path(arg, pathlen);
if (path) {
add_rpath(cc, path);
- free(path);
+
lt_const_
free(path);
}
}
#endif