Author loewis
Recipients ebfe, georg.brandl, ggenellina, loewis, pitrou
Date 2008-12-29.13:31:40
SpamBayes Score 0.00284449
Marked as misclassified No
Message-id <>
In-reply-to <>
> Whenever the documentation says "you must not" it really says "don't do
> that or your application *will* crash, burn and die"... Of course I can
> allocate storage for the string, copy it's content and then free or -
> nothing will happen. How would it cause a crash - it's my own pointer.

Suppose you do

  char *s = malloc(MAXPATH);
  if (!PyArg_ParseTuple("s", &s))return NULL;

then your application *will* crash, burn, and die - because s gets
changed in the call; the original malloc result is garbage, and the
free call will likely crash the malloc implementation (as the block
it points to wasn't malloc-allocated, and isn't the beginning of a
Date User Action Args
2008-12-29 13:31:41loewissetrecipients: + loewis, georg.brandl, ggenellina, pitrou, ebfe
2008-12-29 13:31:41loewislinkissue4746 messages
2008-12-29 13:31:40loewiscreate