Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    r0071c88 r7dcef03  
    7070
    7171  if(pair ==  NULL) {
    72     pair = g_new(owl_pair, 1);
     72    pair = g_slice_new(owl_pair);
    7373    owl_pair_create(pair, attrname, NULL);
    7474    g_ptr_array_add(m->attributes, pair);
     
    836836
    837837 
    838   /* set the "isprivate" attribute if it's a private zephyr.
    839    ``private'' means recipient is non-empty and doesn't start wit
    840    `@' */
    841   if (*n->z_recipient && *n->z_recipient != '@') {
     838  /* set the "isprivate" attribute if it's a private zephyr. */
     839  if (owl_zwrite_recip_is_personal(n->z_recipient)) {
    842840    owl_message_set_isprivate(m);
    843841  }
     
    877875  if (owl_global_is_zcrypt(&g) && !strcasecmp(n->z_opcode, "crypt")) {
    878876    const char *argv[] = {
    879       "zcrypt",
     877      NULL,
    880878      "-D",
    881879      "-c", owl_message_get_class(m),
     
    883881      NULL
    884882    };
    885     char *out;
     883    char *out = NULL;
    886884    int rv;
    887885    int status;
     
    889887
    890888    zcrypt = g_build_filename(owl_get_bindir(), "zcrypt", NULL);
    891 
    892     rv = call_filter(zcrypt, argv, owl_message_get_body(m), &out, &status);
     889    argv[0] = zcrypt;
     890
     891    rv = call_filter(argv, owl_message_get_body(m), &out, &status);
    893892    g_free(zcrypt);
    894893
     
    899898      }
    900899      owl_message_set_body(m, out);
    901       g_free(out);
    902     } else if(out) {
    903       g_free(out);
    904     }
     900    } else {
     901      /* Replace the opcode. Otherwise the UI and other bits of code think the
     902       * message was encrypted. */
     903      owl_message_set_opcode(m, "failed-decrypt");
     904    }
     905    g_free(out);
    905906  }
    906907
     
    10181019    p = m->attributes->pdata[i];
    10191020    g_free(owl_pair_get_value(p));
    1020     g_free(p);
     1021    g_slice_free(owl_pair, p);
    10211022  }
    10221023
     
    10291030{
    10301031  owl_message_cleanup(m);
    1031   g_free(m);
    1032 }
     1032  g_slice_free(owl_message, m);
     1033}
Note: See TracChangeset for help on using the changeset viewer.