Patchwork [1,of,6,v2] parsers: pass variable with correct constness to free

login
register
mail settings
Submitter Henrik Stuart
Date Sept. 9, 2014, 5:51 p.m.
Message ID <e6db2b7bcb27e528bef2.1410285097@yggdrasil>
Download mbox | patch
Permalink /patch/5739/
State Accepted
Headers show

Comments

Henrik Stuart - Sept. 9, 2014, 5:51 p.m.
# HG changeset patch
# User Henrik Stuart <hg@hstuart.dk>
# Date 1410199446 -7200
#      Mon Sep 08 20:04:06 2014 +0200
# Node ID e6db2b7bcb27e528bef28932babd08dd4c05aae6
# Parent  c5df4af17110838b713d6c9ec3b824fb0b6c1b33
parsers: pass variable with correct constness to free

Normalized const-ness call to free to omit warnings with both gcc and
Microsoft Visual C++. Fix triggered by warning from Microsoft Visual C++ 2008.

Patch

diff -r c5df4af17110 -r e6db2b7bcb27 mercurial/parsers.c
--- a/mercurial/parsers.c	Thu Sep 04 09:59:23 2014 -0400
+++ b/mercurial/parsers.c	Mon Sep 08 20:04:06 2014 +0200
@@ -739,7 +739,7 @@ 
 		self->cache = NULL;
 	}
 	if (self->offsets) {
-		free(self->offsets);
+		free((char**)self->offsets);
 		self->offsets = NULL;
 	}
 	if (self->nt) {