From milbo at sonic.net  Sat Jan  3 10:25:08 2009
From: milbo at sonic.net (milbo at sonic.net)
Date: Sat,  3 Jan 2009 10:25:08 +0100 (CET)
Subject: [Rd] Missing PROTECT in intern_getwd (in util.c) (PR#13424)
Message-ID: <20090103092508.643B5282EFF6@mail.pubhealth.ku.dk>

Full_Name: Stephen Milborrow
Version: 2.8.1
OS: WinXP
Submission from: (NULL) (198.54.202.150)


There is a missing PROTECT in intern_getwd in util.c. The current code is

  rval = allocVector(STRSXP, 1);
  SET_STRING_ELT(rval, 0, mkCharCE(buf, CE_UTF8));

and should be (because mkCharCE can allocate memory)

  PROTECT(rval = allocVector(STRSXP, 1));
  SET_STRING_ELT(rval, 0, mkCharCE(buf, CE_UTF8));
  UNPROTECT(1);

This was seen in R version 2.8.1 mingw32



[Rd] Missing PROTECT in intern_getwd (in util.c) (PR#13424)
milbo at sonic.net