Changeset 96828e4 for zephyr.c


Ignore:
Timestamp:
Feb 11, 2011, 4:31:33 PM (12 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
  • zephyr.c

    rdf3a1f4 r96828e4  
    229229    owl_free(subs);
    230230  } else {
    231     owl_sub_list *s = owl_malloc(sizeof(owl_sub_list));
     231    owl_sub_list *s = g_new(owl_sub_list, 1);
    232232    s->subs = subs;
    233233    s->nsubs = count;
     
    259259  struct stat statbuff;
    260260
    261   subs = owl_malloc(sizeof(ZSubscription_t) * subSize);
     261  subs = g_new(ZSubscription_t, subSize);
    262262  subsfile = owl_zephyr_dotfile(".zephyr.subs", filename);
    263263
     
    333333  int count, ret;
    334334
    335   subs = owl_malloc(sizeof(ZSubscription_t) * subSize);
     335  subs = g_new(ZSubscription_t, subSize);
    336336  ZResetAuthentication();
    337337  count=0;
     
    377377  struct stat statbuff;
    378378
    379   subs = owl_malloc(numSubs * sizeof(ZSubscription_t));
     379  subs = g_new(ZSubscription_t, numSubs);
    380380  subsfile = owl_zephyr_dotfile(".anyone", filename);
    381381
     
    694694
    695695  notice.z_message_len=strlen(zsig)+1+strlen(message);
    696   notice.z_message=owl_malloc(notice.z_message_len+10);
     696  notice.z_message=g_new(char, notice.z_message_len+10);
    697697  strcpy(notice.z_message, zsig);
    698698  memcpy(notice.z_message+strlen(zsig)+1, message, strlen(message));
     
    13331333          if (ret == ZERR_NONE) {
    13341334            /* Send a PSEUDO LOGIN! */
    1335             m = owl_malloc(sizeof(owl_message));
     1335            m = g_new(owl_message, 1);
    13361336            owl_message_create_pseudo_zlogin(m, 0, zald->user,
    13371337                                             location.host,
     
    13461346        /* Send a PSEUDO LOGOUT! */
    13471347        if (notify) {
    1348           m = owl_malloc(sizeof(owl_message));
     1348          m = g_new(owl_message, 1);
    13491349          owl_message_create_pseudo_zlogin(m, 1, zald->user, "", "", "");
    13501350          owl_global_messagequeue_addmsg(&g, m);
     
    14211421
    14221422      /* create the new message */
    1423       m=owl_malloc(sizeof(owl_message));
     1423      m=g_new(owl_message, 1);
    14241424      owl_message_create_from_znotice(m, &notice);
    14251425
Note: See TracChangeset for help on using the changeset viewer.