Re: cppcheck: VDR 1.7.18: [recording.c:1130]: (error) Allocation with UpdateFileName, TouchFile doesn't release it.

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

 



On 15.06.2011 15:21, Paul Menzel wrote:
Dear VDR folks,


using Cppcheck 1.49 [1] to check VDR 1.7.18 the above error is shown.
Unfortunately I do not know how to fix this.

The following methods are the following (from two files).

         void cRecordings::TouchUpdate(void)
         {
           bool needsUpdate = NeedsUpdate();
           TouchFile(UpdateFileName());
           if (!needsUpdate)
              lastUpdate = time(NULL); // make sure we don't tigger ourselves
         }

         const char *cRecordings::UpdateFileName(void)
         {
           if (!updateFileName)
              updateFileName = strdup(AddDirectory(VideoDirectory, ".update"));
           return updateFileName;
         }

         void TouchFile(const char *FileName)
         {
           if (utime(FileName, NULL) == -1&&  errno != ENOENT)
              LOG_ERROR_STR(FileName);
         }


Thanks,

Paul


[1] http://cppcheck.sourceforge.net/

The update file name is initialized exactly once and lives until
the end of the program. There is no need to delete it, the
memory will be released when the program ends.

Klaus

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[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