Changeset 96828e4 for util.c


Ignore:
Timestamp:
Feb 11, 2011, 4:31:33 PM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
35b6eb9
Parents:
9518a85
git-author:
Anders Kaseorg <andersk@mit.edu> (08/27/09 00:51:45)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:33)
Message:
Replace owl_malloc with g_new and g_new0.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Karl Ramm <kcr@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • util.c

    r6965867 r96828e4  
    4141  struct passwd *pw;
    4242
    43   out=owl_malloc(MAXPATHLEN+1);
     43  out=g_new(char, MAXPATHLEN+1);
    4444  out[0]='\0';
    4545  j=strlen(in);
     
    294294/* hooks for doing memory allocation et. al. in owl */
    295295
    296 void *owl_malloc(size_t size)
    297 {
    298   return(g_malloc(size));
    299 }
    300 
    301296void owl_free(void *ptr)
    302297{
     
    593588  if (g_utf8_validate(in, -1, NULL)) {
    594589    const char *s, *p;
    595     r = owl_malloc(strlen(in)+1);
     590    r = g_new(char, strlen(in)+1);
    596591    r[0] = '\0';
    597592    s = in;
     
    718713/* Read a line from fp, allocating memory to hold it, returning the number of
    719714 * byte read.  *s should either be NULL or a pointer to memory allocated with
    720  * owl_malloc; it will be owl_realloc'd as appropriate.  The caller must
     715 * g_malloc; it will be owl_realloc'd as appropriate.  The caller must
    721716 * eventually free it.  (This is roughly the interface of getline in the gnu
    722717 * libc).
Note: See TracChangeset for help on using the changeset viewer.