Index: aim.c
===================================================================
--- aim.c	(revision c6adf1779fe578bd628ad351bc8d99f756ea8e93)
+++ aim.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -134,6 +134,5 @@
   
   /* this will leak, I know and just don't care right now */
-  priv=owl_malloc(sizeof(struct owlfaim_priv));
-  memset(priv, 0, sizeof(struct owlfaim_priv));
+  priv=g_new0(struct owlfaim_priv, 1);
 
   priv->screenname = owl_strdup(screenname);
@@ -435,5 +434,5 @@
 
   j=strlen(in);
-  out=owl_malloc(j+30);
+  out=g_new(char, j+30);
   k=0;
   for (i=0; i<j; i++) {
@@ -1046,5 +1045,5 @@
   wrapmsg=owl_text_wordwrap(stripmsg, 70);
   nz_screenname=owl_aim_normalize_screenname(userinfo->sn);
-  m=owl_malloc(sizeof(owl_message));
+  m=g_new(owl_message, 1);
   owl_message_create_aim(m,
 			 nz_screenname,
Index: buddylist.c
===================================================================
--- buddylist.c	(revision 1c4b4ca38b5f4468d1ef6820e1b142709dbdc91d)
+++ buddylist.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -11,5 +11,5 @@
 {
   owl_buddy *b;
-  b=owl_malloc(sizeof(owl_buddy));
+  b=g_new(owl_buddy, 1);
   
   owl_buddy_create(b, OWL_PROTOCOL_AIM, screenname);
@@ -52,5 +52,5 @@
 
     /* if not, create the login message */
-    m=owl_malloc(sizeof(owl_message));
+    m=g_new(owl_message, 1);
     owl_message_create_aim(m,
 			   screenname,
@@ -71,5 +71,5 @@
 
   if (owl_buddylist_is_aim_buddy_loggedin(bl, screenname)) {
-    m=owl_malloc(sizeof(owl_message));
+    m=g_new(owl_message, 1);
     owl_message_create_aim(m,
 			   screenname,
Index: cmd.c
===================================================================
--- cmd.c	(revision 4d24650f1cf9eb23cc96f30f90f4880a91447aac)
+++ cmd.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -50,5 +50,5 @@
 int owl_cmddict_add_alias(owl_cmddict *cd, const char *alias_from, const char *alias_to) {
   owl_cmd *cmd;
-  cmd = owl_malloc(sizeof(owl_cmd));
+  cmd = g_new(owl_cmd, 1);
   owl_cmd_create_alias(cmd, alias_from, alias_to);
   owl_perlconfig_new_command(cmd->name);
@@ -58,5 +58,5 @@
 
 int owl_cmddict_add_cmd(owl_cmddict *cd, const owl_cmd * cmd) {
-  owl_cmd * newcmd = owl_malloc(sizeof(owl_cmd));
+  owl_cmd * newcmd = g_new(owl_cmd, 1);
   if(owl_cmd_create_from_template(newcmd, cmd) < 0) {
     owl_free(newcmd);
Index: commands.c
===================================================================
--- commands.c	(revision fba2a65e9579a0c7a2206186209d9158aaec8f73)
+++ commands.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -1328,5 +1328,5 @@
   char opt;
   int instance = 0, related = 0, i;
-  const char **tmp_argv = owl_malloc(sizeof(char *) * argc);
+  const char **tmp_argv = g_new(const char *, argc);
 
   static const struct option options[] = {
Index: context.c
===================================================================
--- context.c	(revision cb815703a7908e1a1eb7879671b9e1e7471418ed)
+++ context.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -11,6 +11,5 @@
   if (!(mode & OWL_CTX_MODE_BITS))
     mode |= OWL_CTX_INTERACTIVE;
-  c = owl_malloc(sizeof *c);
-  memset(c, 0, sizeof(*c));
+  c = g_new0(owl_context, 1);
   c->mode = mode;
   c->data = data;
Index: dict.c
===================================================================
--- dict.c	(revision d53735037c51cf5abac8fd343a28c2a78bde3065)
+++ dict.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -17,5 +17,5 @@
 int owl_dict_create(owl_dict *d) {
   d->size=0;
-  d->els=owl_malloc(INITSIZE*sizeof(owl_dict_el));
+  d->els=g_new(owl_dict_el, INITSIZE);
   d->avail=INITSIZE;
   if (d->els==NULL) return(-1);
Index: editwin.c
===================================================================
--- editwin.c	(revision 5f8ec6ba33eb0e76426df48dda03b8eb6a61b1a8)
+++ editwin.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -72,7 +72,5 @@
 static owl_editwin *owl_editwin_allocate(void)
 {
-  owl_editwin *e;
-  e = owl_malloc(sizeof(owl_editwin));
-  memset(e, 0, sizeof(*e));
+  owl_editwin *e = g_new0(owl_editwin, 1);
   e->refcount = 1;
   return e;
@@ -123,5 +121,5 @@
                               owl_history *hist)
 {
-  e->buff=owl_malloc(INCR);
+  e->buff=g_new(char, INCR);
   e->buff[0]='\0';
   e->bufflen=0;
@@ -303,5 +301,5 @@
 
   if (lock > 0) {
-    locktext = owl_malloc(lock+1);
+    locktext = g_new(char, lock+1);
     strncpy(locktext, e->buff, lock);
     locktext[lock] = 0;
@@ -382,5 +380,5 @@
 owl_editwin_excursion *owl_editwin_begin_excursion(owl_editwin *e)
 {
-  owl_editwin_excursion *x = owl_malloc(sizeof *x);
+  owl_editwin_excursion *x = g_new(owl_editwin_excursion, 1);
   oe_save_excursion(e, x);
   return x;
@@ -747,5 +745,5 @@
     return;
 
-  tmp = owl_malloc((end - start) + 1);
+  tmp = g_new(char, (end - start) + 1);
   tmp[(end - start)] = 0;
   memcpy(tmp, middle, end - middle);
@@ -1072,5 +1070,5 @@
   char *killbuf = owl_global_get_kill_buffer(&g);
 
-  p = owl_malloc(len + 1);
+  p = g_new(char, len + 1);
 
   if (p != NULL) {
@@ -1408,5 +1406,5 @@
   char *p;
   
-  p = owl_malloc(end - start + 1);
+  p = g_new(char, end - start + 1);
   memcpy(p, e->buff + start, end - start);
   p[end - start] = 0;
Index: filter.c
===================================================================
--- filter.c	(revision 75c7e8ebf74f416b938a43b531665fdcf251700f)
+++ filter.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -19,5 +19,5 @@
   owl_filter *f;
 
-  f = owl_malloc(sizeof(owl_filter));
+  f = g_new(owl_filter, 1);
 
   f->name=owl_strdup(name);
@@ -70,5 +70,5 @@
   if(!argc) return NULL;
 
-  fe = owl_malloc(sizeof(owl_filterelement));
+  fe = g_new(owl_filterelement, 1);
   owl_filterelement_create(fe);
 
@@ -133,5 +133,5 @@
     op2 = owl_filter_parse_primitive_expression(argc-i-1, argv+i+1, &skip);
     if(!op2) goto err;
-    tmp = owl_malloc(sizeof(owl_filterelement));
+    tmp = g_new(owl_filterelement, 1);
     if(!strcasecmp(argv[i], "and")) {
       owl_filterelement_create_and(tmp, op1, op2);
Index: fmtext.c
===================================================================
--- fmtext.c	(revision 099597c2cb6389a72841e1aa2b7e3a381b4e500d)
+++ fmtext.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -640,5 +640,5 @@
     } else if (ptr[0]=='@') {
       /* add the text up to this point then deal with the stack */
-      buff=owl_malloc(ptr-txtptr+20);
+      buff=g_new(char, ptr-txtptr+20);
       strncpy(buff, txtptr, ptr-txtptr);
       buff[ptr-txtptr]='\0';
@@ -675,5 +675,5 @@
       /* check what command we've got, push it on the stack, start
          using it, and continue ... unless it's a color command */
-      buff=owl_malloc(tmpptr-ptr+20);
+      buff=g_new(char, tmpptr-ptr+20);
       strncpy(buff, ptr, tmpptr-ptr);
       buff[tmpptr-ptr]='\0';
@@ -738,5 +738,5 @@
 
           /* grab the color name */
-          buff=owl_malloc(tmpptr-txtptr+20);
+          buff=g_new(char, tmpptr-txtptr+20);
           strncpy(buff, txtptr, tmpptr-txtptr);
           buff[tmpptr-txtptr]='\0';
@@ -765,5 +765,5 @@
     } else if (ptr[0]=='}' || ptr[0]==']' || ptr[0]==')' || ptr[0]=='>') {
       /* add the text up to this point first */
-      buff=owl_malloc(ptr-txtptr+20);
+      buff=g_new(char, ptr-txtptr+20);
       strncpy(buff, txtptr, ptr-txtptr);
       buff[ptr-txtptr]='\0';
@@ -776,5 +776,5 @@
       /* first, if the stack is empty we must bail (just print and go) */
       if (stacksize==0) {
-        buff=owl_malloc(5);
+        buff=g_new(char, 5);
         buff[0]=ptr[0];
         buff[1]='\0';
@@ -802,5 +802,5 @@
       } else {
         /* otherwise print and continue */
-        buff=owl_malloc(5);
+        buff=g_new(char, 5);
         buff[0]=ptr[0];
         buff[1]='\0';
@@ -812,5 +812,5 @@
     } else {
       /* we've found an unattached opener, print everything and move on */
-      buff=owl_malloc(ptr-txtptr+20);
+      buff=g_new(char, ptr-txtptr+20);
       strncpy(buff, txtptr, ptr-txtptr+1);
       buff[ptr-txtptr+1]='\0';
@@ -864,7 +864,7 @@
   short i;
   /* The test is <= because we allocate COLORS+1 entries. */
-  cpmgr->pairs = owl_malloc((COLORS+1) * sizeof(short*));
+  cpmgr->pairs = g_new(short *, COLORS + 1);
   for(i = 0; i <= COLORS; i++) {
-    cpmgr->pairs[i] = owl_malloc((COLORS+1) * sizeof(short));
+    cpmgr->pairs[i] = g_new(short, COLORS + 1);
   }
   owl_fmtext_reset_colorpairs(cpmgr);
Index: functions.c
===================================================================
--- functions.c	(revision 9518a859987b60867c3566157ad0a24358cd28fb)
+++ functions.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -234,5 +234,5 @@
   owl_message *m;
 
-  m=owl_malloc(sizeof(owl_message));
+  m=g_new(owl_message, 1);
   owl_message_create_admin(m, header, body);
   
@@ -257,5 +257,5 @@
 
   /* create the message */
-  m=owl_malloc(sizeof(owl_message));
+  m=g_new(owl_message, 1);
   owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z));
 
@@ -275,5 +275,5 @@
   if (!owl_global_is_aimloggedin(&g)) return(NULL);
   
-  m=owl_malloc(sizeof(owl_message));
+  m=g_new(owl_message, 1);
   owl_message_create_aim(m,
 			 owl_global_get_aim_screenname(&g),
@@ -294,5 +294,5 @@
 
   /* create the message */
-  m=owl_malloc(sizeof(owl_message));
+  m=g_new(owl_message, 1);
   owl_message_create_loopback(m, body);
   owl_message_set_direction_out(m);
@@ -553,5 +553,5 @@
   /* create a message and put it on the message queue.  This simulates
    * an incoming message */
-  min=owl_malloc(sizeof(owl_message));
+  min=g_new(owl_message, 1);
   mout=owl_function_make_outgoing_loopback(msg);
 
@@ -3457,5 +3457,5 @@
   for (i = 0; i < j; i++) {
     user = owl_list_get_element(&anyone, i);
-    zald = owl_malloc(sizeof(ZAsyncLocateData_t));
+    zald = g_new(ZAsyncLocateData_t, 1);
     if (ZRequestLocations(zstr(user), zald, UNACKED, ZAUTH) == ZERR_NONE) {
       *zaldlist = g_list_append(*zaldlist, zald);
Index: global.c
===================================================================
--- global.c	(revision d3941a01cb492fb3533b38832bc7e5afe9064bf2)
+++ global.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -568,5 +568,5 @@
 
 void owl_global_add_filter(owl_global *g, owl_filter *f) {
-  owl_global_filter_ent *e = owl_malloc(sizeof *e);
+  owl_global_filter_ent *e = g_new(owl_global_filter_ent, 1);
   e->g = g;
   e->f = f;
Index: keybinding.c
===================================================================
--- keybinding.c	(revision d275eb230e4d493acbb920b9bae25b692b199412)
+++ keybinding.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -45,5 +45,5 @@
     return(-1);
   }
-  kb->keys = owl_malloc(nktokens*sizeof(int));
+  kb->keys = g_new(int, nktokens);
   for (i=0; i<nktokens; i++) {
     kb->keys[i] = owl_keypress_fromstring(ktokens[i]);
Index: keymap.c
===================================================================
--- keymap.c	(revision 44cc9abbc2c15abaf4cd5fe0d1fc62b0e0936913)
+++ keymap.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -38,5 +38,5 @@
   int i;
 
-  if ((kb = owl_malloc(sizeof(owl_keybinding))) == NULL) return(-1);
+  if ((kb = g_new(owl_keybinding, 1)) == NULL) return(-1);
   if (0 != owl_keybinding_init(kb, keyseq, command, function_fn, desc)) {
     owl_free(kb);
@@ -63,5 +63,5 @@
   int i;
 
-  if ((kb = owl_malloc(sizeof(owl_keybinding))) == NULL) return(-1);
+  if ((kb = g_new(owl_keybinding, 1)) == NULL) return(-1);
   if (0 != owl_keybinding_make_keys(kb, keyseq)) {
     owl_free(kb);
@@ -197,5 +197,5 @@
 {
   owl_keymap *km;
-  km = owl_malloc(sizeof(owl_keymap));
+  km = g_new(owl_keymap, 1);
   if (!km) return NULL;
   owl_keymap_init(km, name, desc, default_fn, prealways_fn, postalways_fn);
Index: list.c
===================================================================
--- list.c	(revision 5e5f08f3fcfd064d18df1008f09c00202a36ffdb)
+++ list.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -8,5 +8,5 @@
 {
   l->size=0;
-  l->list=owl_malloc(INITSIZE*sizeof(void *));
+  l->list=g_new(void *, INITSIZE);
   l->avail=INITSIZE;
   if (l->list==NULL) return(-1);
Index: logging.c
===================================================================
--- logging.c	(revision c366cbd17d30a37a0f7cefae45f0d967341b659a)
+++ logging.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -182,5 +182,5 @@
    * owl_log_shouldlog_message(void)
    */
-  m = owl_malloc(sizeof(owl_message));
+  m = g_new(owl_message, 1);
   owl_message_create_from_zwrite(m, zw, text);
   if (!owl_log_shouldlog_message(m)) {
Index: message.c
===================================================================
--- message.c	(revision 719119de6c2aeaa0b75be7f6aac0cbaee43f36d8)
+++ message.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -75,5 +75,5 @@
 
   if(pair ==  NULL) {
-    pair = owl_malloc(sizeof(owl_pair));
+    pair = g_new(owl_pair, 1);
     owl_pair_create(pair, attrname, NULL);
     owl_list_append_element(&(m->attributes), pair);
Index: perlconfig.c
===================================================================
--- perlconfig.c	(revision c107129f3d6ac9d0c0364b854d48c20a068cecf6)
+++ perlconfig.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -193,5 +193,5 @@
   hash = (HV*)SvRV(msg);
 
-  m = owl_malloc(sizeof(owl_message));
+  m = g_new(owl_message, 1);
   owl_message_init(m);
 
Index: perlglue.xs
===================================================================
--- perlglue.xs	(revision 40382e0dceafcb229fa5bf6a4c8c8f6390f2763e)
+++ perlglue.xs	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -43,5 +43,5 @@
 			rv = owl_function_command(cmd);
 		} else {
-			argv = owl_malloc((items + 1) * sizeof *argv);
+			argv = g_new(const char *, items + 1);
 			argv[0] = cmd;
 			for(i = 1; i < items; i++) {
@@ -287,5 +287,5 @@
      CODE:
 	{
-		s = owl_malloc(sizeof(owl_style));
+		s = g_new(owl_style, 1);
 		owl_style_create_perl(s, name, newSVsv(object));
 		owl_global_add_style(&g, s);
Index: popexec.c
===================================================================
--- popexec.c	(revision 9eb38bb4825e0c7f73087fbd9f851aa0305ccedd)
+++ popexec.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -22,5 +22,5 @@
   }
 
-  pe = owl_malloc(sizeof(owl_popexec));
+  pe = g_new(owl_popexec, 1);
   if (!pe) return NULL;
   pe->winactive=0;
@@ -126,5 +126,5 @@
   if (navail<=0) return;
   if (navail>1024) { navail = 1024; }
-  buf = owl_malloc(navail+1);
+  buf = g_new(char, navail+1);
   owl_function_debugmsg("about to read %d", navail);
   bread = read(d->fd, buf, navail);
Index: popwin.c
===================================================================
--- popwin.c	(revision 9b9efa2bdfee90c930a03ebb8e64a02c85a50e8c)
+++ popwin.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -3,6 +3,5 @@
 owl_popwin *owl_popwin_new(void)
 {
-  owl_popwin *pw = owl_malloc(sizeof(owl_popwin));
-  memset(pw, 0, sizeof(*pw));
+  owl_popwin *pw = g_new0(owl_popwin, 1);
 
   pw->border = owl_window_new(NULL);
Index: select.c
===================================================================
--- select.c	(revision a409a9dc053a26b10c993c0f93574092abfd3c21)
+++ select.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -15,5 +15,5 @@
 owl_timer *owl_select_add_timer(const char* name, int after, int interval, void (*cb)(owl_timer *, void *), void (*destroy)(owl_timer*), void *data)
 {
-  owl_timer *t = owl_malloc(sizeof(owl_timer));
+  owl_timer *t = g_new(owl_timer, 1);
   GList **timers = owl_global_get_timerlist(&g);
 
@@ -159,5 +159,5 @@
 const owl_io_dispatch *owl_select_add_io_dispatch(int fd, int mode, void (*cb)(const owl_io_dispatch *, void *), void (*destroy)(const owl_io_dispatch *), void *data)
 {
-  owl_io_dispatch *d = owl_malloc(sizeof(owl_io_dispatch));
+  owl_io_dispatch *d = g_new(owl_io_dispatch, 1);
   owl_list *dl = owl_global_get_io_dispatch_list(&g);
 
@@ -299,5 +299,5 @@
 owl_ps_action *owl_select_add_pre_select_action(int (*cb)(owl_ps_action *, void *), void (*destroy)(owl_ps_action *), void *data)
 {
-  owl_ps_action *a = owl_malloc(sizeof(owl_ps_action));
+  owl_ps_action *a = g_new(owl_ps_action, 1);
   owl_list *psa_list = owl_global_get_psa_list(&g);
   a->needs_gc = 0;
Index: text.c
===================================================================
--- text.c	(revision 4d24650f1cf9eb23cc96f30f90f4880a91447aac)
+++ text.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -53,5 +53,5 @@
   char *out, *out2;
 
-  out=owl_malloc(strlen(in)+30);
+  out=g_new(char, strlen(in)+30);
   strcpy(out, "");
 
@@ -156,5 +156,5 @@
   }
 
-  ret = owl_malloc(len + 1);
+  ret = g_new(char, len + 1);
 
   p = in;
@@ -281,5 +281,5 @@
   tolen  = strlen(to);
   fromlen  = strlen(from);
-  out = owl_malloc(outlen);
+  out = g_new(char, outlen);
 
   while (in[inpos]) {
@@ -335,5 +335,5 @@
       escape++;
   }
-  out = owl_malloc(in_len + quotestr_len*escape+1);
+  out = g_new(char, in_len + quotestr_len*escape+1);
   for (i=0; i<in_len; i++) {
 
Index: util.c
===================================================================
--- util.c	(revision 6965867e4c30897f335e20ffcc0a47186e15d7cd)
+++ util.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -41,5 +41,5 @@
   struct passwd *pw;
 
-  out=owl_malloc(MAXPATHLEN+1);
+  out=g_new(char, MAXPATHLEN+1);
   out[0]='\0';
   j=strlen(in);
@@ -294,9 +294,4 @@
 /* hooks for doing memory allocation et. al. in owl */
 
-void *owl_malloc(size_t size)
-{
-  return(g_malloc(size));
-}
-
 void owl_free(void *ptr)
 {
@@ -593,5 +588,5 @@
   if (g_utf8_validate(in, -1, NULL)) {
     const char *s, *p;
-    r = owl_malloc(strlen(in)+1);
+    r = g_new(char, strlen(in)+1);
     r[0] = '\0';
     s = in;
@@ -718,5 +713,5 @@
 /* Read a line from fp, allocating memory to hold it, returning the number of
  * byte read.  *s should either be NULL or a pointer to memory allocated with
- * owl_malloc; it will be owl_realloc'd as appropriate.  The caller must
+ * g_malloc; it will be owl_realloc'd as appropriate.  The caller must
  * eventually free it.  (This is roughly the interface of getline in the gnu
  * libc).
Index: variable.c
===================================================================
--- variable.c	(revision d275eb230e4d493acbb920b9bae25b692b199412)
+++ variable.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -479,5 +479,5 @@
   if (owl_dict_create(vd)) return(-1);
   for (var = variables_to_init; var->name != NULL; var++) {
-    cur = owl_malloc(sizeof(owl_variable));
+    cur = g_new(owl_variable, 1);
     *cur = *var;
     /* strdup all the strings so we can delete them consistently. */
@@ -517,5 +517,5 @@
       if (!cur->delete_fn)
 	cur->delete_fn = owl_variable_delete_default;
-      cur->val = owl_malloc(sizeof(int));
+      cur->val = g_new(int, 1);
       cur->set_fn(cur, &cur->ival_default);
       break;
@@ -533,5 +533,5 @@
       if (!cur->delete_fn)
 	cur->delete_fn = owl_variable_delete_default;
-      cur->val = owl_malloc(sizeof(int));
+      cur->val = g_new(int, 1);
       cur->set_fn(cur, &cur->ival_default);
       break;
@@ -551,6 +551,5 @@
 
 owl_variable * owl_variable_newvar(const char *name, const char *summary, const char * description) {
-  owl_variable * var = owl_malloc(sizeof(owl_variable));
-  memset(var, 0, sizeof(owl_variable));
+  owl_variable * var = g_new0(owl_variable, 1);
   var->name = owl_strdup(name);
   var->summary = owl_strdup(summary);
@@ -601,5 +600,5 @@
     var->get_tostring_fn = owl_variable_int_get_tostring_default;
     var->delete_fn = owl_variable_delete_default;
-    var->val = owl_malloc(sizeof(int));
+    var->val = g_new(int, 1);
     var->set_fn(var, &initval);
     owl_variable_dict_add_variable(vd, var);
@@ -622,5 +621,5 @@
     var->get_tostring_fn = owl_variable_bool_get_tostring_default;
     var->delete_fn = owl_variable_delete_default;
-    var->val = owl_malloc(sizeof(int));
+    var->val = g_new(int, 1);
     var->set_fn(var, &initval);
     owl_variable_dict_add_variable(vd, var);
Index: viewwin.c
===================================================================
--- viewwin.c	(revision cedbe9d12297d7fcfba100bf16111a44f7afa681)
+++ viewwin.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -14,6 +14,5 @@
 owl_viewwin *owl_viewwin_new_text(owl_window *win, const char *text)
 {
-  owl_viewwin *v = owl_malloc(sizeof(owl_viewwin));
-  memset(v, 0, sizeof(*v));
+  owl_viewwin *v = g_new0(owl_viewwin, 1);
   owl_fmtext_init_null(&(v->fmtext));
   if (text) {
@@ -38,6 +37,5 @@
 {
   char *text;
-  owl_viewwin *v = owl_malloc(sizeof(owl_viewwin));
-  memset(v, 0, sizeof(*v));
+  owl_viewwin *v = g_new0(owl_viewwin, 1);
 
   owl_fmtext_copy(&(v->fmtext), fmtext);
@@ -197,5 +195,5 @@
   owl_editwin_insert_string(tw, buffstart);
 
-  data = owl_malloc(sizeof(owl_viewwin_search_data));
+  data = g_new(owl_viewwin_search_data, 1);
   data->v = v;
   data->direction = direction;
Index: zephyr.c
===================================================================
--- zephyr.c	(revision df3a1f46e924bf7f43b5cdc027dd50c55fac679e)
+++ zephyr.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -229,5 +229,5 @@
     owl_free(subs);
   } else {
-    owl_sub_list *s = owl_malloc(sizeof(owl_sub_list));
+    owl_sub_list *s = g_new(owl_sub_list, 1);
     s->subs = subs;
     s->nsubs = count;
@@ -259,5 +259,5 @@
   struct stat statbuff;
 
-  subs = owl_malloc(sizeof(ZSubscription_t) * subSize);
+  subs = g_new(ZSubscription_t, subSize);
   subsfile = owl_zephyr_dotfile(".zephyr.subs", filename);
 
@@ -333,5 +333,5 @@
   int count, ret;
 
-  subs = owl_malloc(sizeof(ZSubscription_t) * subSize);
+  subs = g_new(ZSubscription_t, subSize);
   ZResetAuthentication();
   count=0;
@@ -377,5 +377,5 @@
   struct stat statbuff;
 
-  subs = owl_malloc(numSubs * sizeof(ZSubscription_t));
+  subs = g_new(ZSubscription_t, numSubs);
   subsfile = owl_zephyr_dotfile(".anyone", filename);
 
@@ -694,5 +694,5 @@
 
   notice.z_message_len=strlen(zsig)+1+strlen(message);
-  notice.z_message=owl_malloc(notice.z_message_len+10);
+  notice.z_message=g_new(char, notice.z_message_len+10);
   strcpy(notice.z_message, zsig);
   memcpy(notice.z_message+strlen(zsig)+1, message, strlen(message));
@@ -1333,5 +1333,5 @@
           if (ret == ZERR_NONE) {
             /* Send a PSEUDO LOGIN! */
-            m = owl_malloc(sizeof(owl_message));
+            m = g_new(owl_message, 1);
             owl_message_create_pseudo_zlogin(m, 0, zald->user,
                                              location.host,
@@ -1346,5 +1346,5 @@
         /* Send a PSEUDO LOGOUT! */
         if (notify) {
-          m = owl_malloc(sizeof(owl_message));
+          m = g_new(owl_message, 1);
           owl_message_create_pseudo_zlogin(m, 1, zald->user, "", "", "");
           owl_global_messagequeue_addmsg(&g, m);
@@ -1421,5 +1421,5 @@
 
       /* create the new message */
-      m=owl_malloc(sizeof(owl_message));
+      m=g_new(owl_message, 1);
       owl_message_create_from_znotice(m, &notice);
 
Index: zwrite.c
===================================================================
--- zwrite.c	(revision c6b178299d11350b3d68bd3ee323523f02602b7f)
+++ zwrite.c	(revision 96828e419fe2c4038a99ecfd77a852da754e8244)
@@ -7,5 +7,5 @@
 owl_zwrite *owl_zwrite_new(const char *line)
 {
-  owl_zwrite *z = owl_malloc(sizeof *z);
+  owl_zwrite *z = g_new(owl_zwrite, 1);
   if (owl_zwrite_create_from_line(z, line) < 0) {
     owl_zwrite_delete(z);
