Re: freeing structure



"wanwan" <ericwan78@xxxxxxxxx> writes:

> How about if I do free(obj1->point2sumthing1) while it points to NULL?
> Will it give me a runtime error?

free() of a null pointer is a no-op.
--
Here's a tip: null pointers don't have to be *dull* pointers!
.



Relevant Pages

  • Re: Access violation error
    ... //if i uncomment below line,then it throwing access violation error during ... i have only runtime error. ... I suppose that the method E3Des is defined somewhere, but you know, without TELLING US ... space to initialize those pointers. ...
    (microsoft.public.vc.mfc)
  • Re: Mixing ATL smart pointers with regular calls
    ... Certain pointers are then passes to other ... I believe that it is the cause of a runtime error. ... There is no problem mixing smart pointers with regular calls. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Translating c headers to Delphi
    ... I tried to avoid pointers but i got a runtime error when i tried making a ... where plambData and ppowData are suposed to be pointers to arrays of double. ... >> I'm not quite sure how to use pointers in Delphi. ...
    (borland.public.delphi.language.basm)
  • problem with pointers, runtime error
    ... I use ifc 6.0 under Linux SusE 8.1, and try to do some pointers manipulations. ... end type liste ... compiles with no errors and runs without any runtime error too. ...
    (comp.lang.fortran)
  • Re: Naming curiosity
    ... void *head; ... I don't use a recursive structure using pointers to the structure itself ... struct sList *prev; ... misunderstand the real purpose of the head field. ...
    (comp.lang.c)