Branch: Tag:

2003-05-07

2003-05-07 16:12:17 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed a few leaks due to improper use of this_object().

Rev: src/post_modules/Nettle/hash.cmod:1.5

1:   /* hash.cmod -*- c -*- */      #include "global.h" - RCSID("$Id: hash.cmod,v 1.4 2003/03/18 15:41:57 nilsson Exp $"); + RCSID("$Id: hash.cmod,v 1.5 2003/05/07 16:12:17 grubba Exp $");   #include "interpret.h"   #include "svalue.h"   
116:    */    PIKEFUN object update(string data)    { -  const struct nettle_hash *meta = GET_META(this_object()); +  const struct nettle_hash *meta = +  GET_META(Pike_fp->current_object);       if (!THIS->ctx || !meta)    Pike_error("hash_state not properly initialized.");
147:    if (! THIS->ctx)    Pike_error("hash_state not properly initialized.");    -  meta = GET_META(this_object()); +  meta = GET_META(Pike_fp->current_object);    assert(meta);       if (!arg)
179:    werror("HashState->EXIT\n");    if (THIS->ctx)    { -  const struct nettle_hash *meta = GET_META(this_object()); +  const struct nettle_hash *meta = +  GET_META(Pike_fp->current_object);    assert(meta);    memset(THIS->ctx, 0, meta->context_size);    }
198:    INIT    {    struct HashInfo_struct *HashInfo -  = (struct HashInfo_struct *) get_storage(this_object(), +  = (struct HashInfo_struct *) get_storage(Pike_fp->current_object,    HashInfo_program);       werror("MD5_Info->INIT\n");
227:    INIT    {    struct HashState_struct *instance -  = (struct HashState_struct *) get_storage(this_object(), +  = (struct HashState_struct *) get_storage(Pike_fp->current_object,    HashState_program);    werror("MD5_State->INIT\n");   
249:    INIT    {    struct HashInfo_struct *HashInfo -  = (struct HashInfo_struct *) get_storage(this_object(), +  = (struct HashInfo_struct *) get_storage(Pike_fp->current_object,    HashInfo_program);       werror("SHA1_Info->INIT\n");
279:    INIT    {    struct HashState_struct *instance -  = (struct HashState_struct *) get_storage(this_object(), +  = (struct HashState_struct *) get_storage(Pike_fp->current_object,    HashState_program);    werror("SHA1_State->INIT\n");