X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fstr.c;h=bde4de4be5bb4ee13edf877e217537336debfc0a;hb=c75794cffb05769b71a346af8513a3e8dde55f94;hp=71f54474d57f995f8c5b73572e1d8f761b7e934e;hpb=51c3424bf88d0fa110683fbcdd208d0fa5c98179;p=pspp diff --git a/src/libpspp/str.c b/src/libpspp/str.c index 71f54474d5..bde4de4be5 100644 --- a/src/libpspp/str.c +++ b/src/libpspp/str.c @@ -1465,7 +1465,9 @@ ds_relocate (struct string *st) { ds_clear (st); ds_put_cstr (st, rel); - free ((char *) rel); + /* The documentation for relocate says that casting away const + and then freeing is appropriate ... */ + free (CONST_CAST (char *, rel)); } }