vdr 1.3.25 thread problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>      asprintf(&cmd, "%s %s \"%s\"", command, State, *strescape(RecordingFileName, "\"$"));
> 
> Does asprintf know it can release the memory?

Certainly not.

I am by no way a C++ expert but I think *strescape is treated as an automatically
allocated object which will automatically be destroyed when its scope is left.
You only need to delete objects which have been created with new.

The same should be true for your first example in cTDT::cTDT()

You can put debug output into cString::~cString() to verify that.

> What happens if the malloc fails?

You will find a dozen or so places in vdr where the MALLOC result is not
checked for NULL. I just wonder why in some cases there are checks like 
here:

cResumeFile::cResumeFile(const char *FileName)
{
  fileName = MALLOC(char, strlen(FileName) + strlen(RESUMEFILESUFFIX) + 1);
  if (fileName) {


-- 
Wolfgang


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux