pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*-   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin.cmod,v 1.205 2008/06/10 20:56:26 mast Exp $ + || $Id: builtin.cmod,v 1.206 2008/06/16 23:22:10 mast Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin.cmod:2190:    /* NOTE: from and to are only kept for _encode()'s use. */    CVAR struct array *from;    CVAR struct array *to;       /*! @decl void create(array(string)|mapping(string:string)|void from, @    *! array(string)|string|void to)    */    PIKEFUN void create(array(string)|mapping(string:string)|void from_arg,    array(string)|string|void to_arg)    { -  if (THIS->from) free_array(THIS->from); -  if (THIS->to) free_array(THIS->to); -  if (THIS->ctx.v) free_replace_many_context(&THIS->ctx); +  if (THIS->from) { +  free_array(THIS->from); +  THIS->from = NULL; +  } +  if (THIS->to) { +  free_array(THIS->to); +  THIS->to = NULL; +  } +  if (THIS->ctx.v) { +  free_replace_many_context(&THIS->ctx); +  THIS->ctx.v = NULL; +  }       if (!args) {    push_int(0);    return;    }    if (from_arg && from_arg->type == T_MAPPING) {    if (to_arg) {    Pike_error("Bad number of arguments to create().\n");    }    THIS->from = mapping_indices(from_arg->u.mapping);