pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] time module unit test cases


From: jemarch
Subject: Re: [pdf-devel] time module unit test cases
Date: Sat, 19 Apr 2008 09:24:24 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (powerpc-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)


   BTW, since the modules are public someone could do:

   ##
   list = pdf_alloc (sizeof(pdf_list_t));
   pdf_list_create (l_comp, l_disp, 0, list);
   ###

   If the user don't check for the NULL pointer after calling alloc(), and
   pdf_list_create() either a segfault would ocurr and the user will say that 
its
   the library fault.

The documentation of `pdf_alloc' says:

 Returns 
     A pointer to the newly allocated memory.
     If there is not enough available memory to satisfy the petition
     then NULL is returned.

So it is the responsability of the caller (in this case the client
using the library) to check for NULL.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]