pspp-dev
[Top][All Lists]
Advanced

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

any-writer.c


From: John Darrington
Subject: any-writer.c
Date: Sat, 25 Mar 2006 09:32:47 +0800
User-agent: Mutt/1.5.4i

A couple of concerns about any-writer.c :

    if (!strcmp (extension, ".por"))

This is not a very reliable test.  Can we not think of a better way of
guessing a file's type.  If not, at least make this a case insensitive
compare?


static struct any_writer *
make_any_writer (enum any_writer_type type, void *private)
{
  if (private != NULL)
    {
      struct any_writer *writer = xmalloc (sizeof *writer);


This xmalloc is never getting freed. 

I'm not sure of the ownership rules of a struct any_writer.  Who is
responsible for freeing it?  

The same goes for struct any_reader.

any_{reader,writer} is an abstract type and any_{reader,writer}_open
is the corresponing abstract factory?  Shouldn't the factory therefore
be responsible for cleaning up the object?

J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: pgpycSFsL4iWP.pgp
Description: PGP signature


reply via email to

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