tree-wide: do not use _cleanup_free_ on const pointers
authorDaniel Mack <daniel@zonque.org>
Fri, 24 Jul 2015 11:49:11 +0000 (13:49 +0200)
committerDaniel Mack <daniel@zonque.org>
Fri, 24 Jul 2015 11:52:30 +0000 (13:52 +0200)
free() cannot be used with const pointers. However, our _cleanup_free_
handler features cast logic that hides that qualifier, so we don't get a
warning.

src/import/pull-dkr.c
src/journal/journal-vacuum.c
src/udev/udev-builtin-hwdb.c

index 78e3184..67ca1ce 100644 (file)
@@ -793,7 +793,7 @@ static void dkr_pull_job_on_finished_v2(PullJob *j) {
 
         } else if (i->tags_job == j) {
                 const char *url;
-                _cleanup_free_ const char *buf;
+                _cleanup_free_ char *buf;
                 _cleanup_json_variant_unref_ JsonVariant *doc = NULL;
                 JsonVariant *e = NULL;
 
index 81a577e..17499bb 100644 (file)
@@ -72,7 +72,7 @@ static void patch_realtime(
                 const struct stat *st,
                 unsigned long long *realtime) {
 
-        _cleanup_free_ const char *path = NULL;
+        _cleanup_free_ char *path = NULL;
         usec_t x, crtime = 0;
 
         /* The timestamp was determined by the file name, but let's
index b656204..72109d9 100644 (file)
@@ -33,7 +33,7 @@ static sd_hwdb *hwdb;
 int udev_builtin_hwdb_lookup(struct udev_device *dev,
                              const char *prefix, const char *modalias,
                              const char *filter, bool test) {
-        _cleanup_free_ const char *lookup = NULL;
+        _cleanup_free_ char *lookup = NULL;
         const char *key, *value;
         int n = 0;