[Reproducible-commits] [dpkg] 37/61: u-a: Do not try to free() a «const char *»

Jérémy Bobbio lunar at moszumanska.debian.org
Mon Sep 21 09:57:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 571df9b2933bbd34c11ba4536875e8c3803e0342
Author: Guillem Jover <guillem at debian.org>
Date:   Tue Sep 15 20:56:36 2015 +0200

    u-a: Do not try to free() a «const char *»
    
    The returned value is always allocated now, and the call sites are
    respinsible for its release, so it should not have been a «const char *»
    pointer, modify the call tree to make it «char *».
    
    Warned-by: gcc
---
 utils/update-alternatives.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index 916a191..791384c 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -1543,7 +1543,7 @@ alternative_print_choice(struct alternative *a, enum alternative_status status,
 	   fs->master_file, fs->priority, alternative_status_describe(status));
 }
 
-static const char *
+static char *
 alternative_select_choice(struct alternative *a)
 {
 	const char *current;
@@ -1612,10 +1612,10 @@ alternative_select_choice(struct alternative *a)
 	}
 }
 
-static const char *
+static char *
 alternative_config(struct alternative *a, const char *current_choice)
 {
-	const char *new_choice = NULL;
+	char *new_choice = NULL;
 
 	if (alternative_choices_count(a) == 0) {
 		pr(_("There is no program which provides %s."),
@@ -2298,7 +2298,7 @@ alternative_config_all(void)
 
 	for (am = alt_map_obj; am && am->item; am = am->next) {
 		const char *current_choice;
-		const char *new_choice;
+		char *new_choice;
 
 		current_choice = alternative_get_current(am->item);
 		alternative_select_mode(am->item, current_choice);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list