Changeset ddbbcffa for util.c


Ignore:
Timestamp:
Feb 11, 2011, 4:31:42 PM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
d4927a7
Parents:
35b6eb9
git-author:
Anders Kaseorg <andersk@mit.edu> (08/27/09 00:52:41)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:42)
Message:
Replace owl_free with g_free.

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

Legend:

Unmodified
Added
Removed
  • util.c

    r35b6eb9 rddbbcffa  
    178178    /* TODO: when we move to requiring glib 2.22+, use
    179179     * g_ptr_array_new_with_free_func. */
    180     g_ptr_array_foreach(argv, (GFunc)owl_free, NULL);
     180    g_ptr_array_foreach(argv, (GFunc)g_free, NULL);
    181181    g_ptr_array_free(argv, true);
    182182    *argc = -1;
     
    262262
    263263/* Returns a quoted version of arg suitable for placing in a
    264  * command-line. Result should be freed with owl_free. */
     264 * command-line. Result should be freed with g_free. */
    265265char *owl_arg_quote(const char *arg)
    266266{
     
    293293
    294294/* hooks for doing memory allocation et. al. in owl */
    295 
    296 void owl_free(void *ptr)
    297 {
    298   g_free(ptr);
    299 }
    300295
    301296char *owl_strdup(const char *s1)
     
    372367    out=owl_strdup(tmp);
    373368    if (!strncmp(out, "/dev/", 5)) {
    374       owl_free(out);
     369      g_free(out);
    375370      out=owl_strdup(tmp+5);
    376371    }
     
    400395
    401396  out=owl_strdup(ptr1);
    402   owl_free(tmp);
     397  g_free(tmp);
    403398  return(out);
    404399}
     
    484479    owl_function_error("Cannot open %s (for writing): %s",
    485480                       actual_filename, strerror(errno));
    486     owl_free(newfile);
     481    g_free(newfile);
    487482    fclose(old);
    488483    free(actual_filename);
     
    495490    unlink(newfile);
    496491    fclose(new);
    497     owl_free(newfile);
     492    g_free(newfile);
    498493    fclose(old);
    499494    free(actual_filename);
     
    506501    else
    507502      numremoved++;
    508   owl_free(buf);
     503  g_free(buf);
    509504
    510505  fclose(new);
     
    516511    if (link(actual_filename, backupfile) != 0) {
    517512      owl_function_error("Cannot link %s: %s", backupfile, strerror(errno));
    518       owl_free(backupfile);
     513      g_free(backupfile);
    519514      unlink(newfile);
    520       owl_free(newfile);
     515      g_free(newfile);
    521516      return -1;
    522517    }
    523     owl_free(backupfile);
     518    g_free(backupfile);
    524519  }
    525520
     
    531526
    532527  unlink(newfile);
    533   owl_free(newfile);
     528  g_free(newfile);
    534529
    535530  g_free(actual_filename);
Note: See TracChangeset for help on using the changeset viewer.