Fix -Wdiscarded-qualifiers warnings in launcher-linux.c
commit1364da0fde0d68c84f3450b192588da97d50760b
authorMark Wielaard <mark@klomp.org>
Thu, 30 May 2019 01:40:56 +0000 (30 03:40 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 30 May 2019 01:40:56 +0000 (30 03:40 +0200)
treeabd554ae5b053db40c3d28d5f3c0548b7291f3c6
parent791fe5ecf909d573bcbf353b677b9404f9da0ed4
Fix -Wdiscarded-qualifiers warnings in launcher-linux.c

commit f15bee "Fix memory leak in launcher-linux.c" introduced some
warnings about passing const pointers to free.

    warning: passing argument 1 of ‘free’ discards ‘const’ qualifier from
    pointer target type [-Wdiscarded-qualifiers]

This was because that code was a little too "smart". The compiler cannot
know that we really only call free () when the pointer was dynamically
allocated. Simplify the code a little to just always allocate a new
string in find_client and always free that string in select_platform.
coregrind/launcher-linux.c