Changeset 223 for trunk


Ignore:
Timestamp:
04/03/11 12:21:04 (14 years ago)
Author:
tim
Message:

switched talloc_steal calls to talloc_reparent for more precision and to eliminate warnings

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/regfi.c

    r219 r223  
    13681368        }
    13691369      }
    1370       talloc_steal(nk, nk->values);
     1370      talloc_reparent(NULL, nk, nk->values);
    13711371    }
    13721372  }
     
    13981398        nk->num_subkeys = 0;
    13991399      }
    1400       talloc_steal(nk, nk->subkeys);
     1400      talloc_reparent(NULL, nk, nk->subkeys);
    14011401    }
    14021402  }
     
    15281528
    15291529  /* In this case, we want file_cb to be freed when ret_val is */
    1530   talloc_steal(ret_val, file_cb);
     1530  talloc_reparent(NULL, ret_val, file_cb);
    15311531  return ret_val;
    15321532
     
    15391539/******************************************************************************
    15401540 ******************************************************************************/
    1541 int regfi_free_cb(void* f)
     1541static int regfi_free_cb(void* f)
    15421542{
    15431543  REGFI_FILE* file = (REGFI_FILE*)f;
     
    16161616    goto fail;
    16171617  }
    1618   talloc_steal(rb, rb->hbins);
     1618  talloc_reparent(NULL, rb, rb->hbins);
    16191619
    16201620  rla = true;
     
    16251625    rla = range_list_add(rb->hbins, hbin->file_off, hbin->block_size, hbin);
    16261626    if(rla)
    1627       talloc_steal(rb->hbins, hbin);
     1627      talloc_reparent(NULL, rb->hbins, hbin);
    16281628
    16291629    hbin_off = hbin->file_off + hbin->block_size;
     
    17941794    return NULL;
    17951795  }
    1796   talloc_steal(ret_val, ret_val->key_positions);
     1796  talloc_reparent(NULL, ret_val, ret_val->key_positions);
    17971797
    17981798  ret_val->f = file;
     
    19281928const REGFI_NK* regfi_iterator_cur_key(REGFI_ITERATOR* i)
    19291929{
    1930   talloc_reference(NULL, i->cur_key);
    1931   return i->cur_key;
     1930  return talloc_reference(NULL, i->cur_key);
    19321931}
    19331932
     
    20562055  ret_val->raw = raw;
    20572056  ret_val->size = parse_length;
    2058   talloc_steal(ret_val, raw);
     2057  talloc_reparent(NULL, ret_val, raw);
    20592058
    20602059  interpreted = talloc_array(NULL, char, parse_length);
     
    20742073  else
    20752074  {
     2075    /* XXX: check for NULL return here? */
    20762076    interpreted = talloc_realloc(NULL, interpreted, char, conv_size);
    20772077    ret_val->interpreted = interpreted;
    2078     talloc_steal(ret_val, interpreted);
     2078    talloc_reparent(NULL, ret_val, interpreted);
    20792079  }
    20802080
     
    22672267    return NULL;
    22682268 
    2269   talloc_steal(ret_val, raw_data.buf);
     2269  talloc_reparent(NULL, ret_val, raw_data.buf);
    22702270  ret_val->raw = raw_data.buf;
    22712271  ret_val->size = raw_data.len;
     
    23192319    }
    23202320
     2321    /* XXX: check for NULL */
    23212322    tmp_str = talloc_realloc(NULL, tmp_str, uint8_t, tmp_size);
    23222323    data->interpreted.string = tmp_str;
    23232324    data->interpreted_size = tmp_size;
    2324     talloc_steal(data, tmp_str);
     2325    talloc_reparent(NULL, data, tmp_str);
    23252326    break;
    23262327
     
    24072408    /* XXX: how meaningful is this?  should we store number of strings instead? */
    24082409    data->interpreted_size = tmp_size;
    2409     talloc_steal(tmp_array, tmp_str);
    2410     talloc_steal(data, tmp_array);
     2410    talloc_reparent(NULL, tmp_array, tmp_str);
     2411    talloc_reparent(NULL, data, tmp_array);
    24112412    break;
    24122413
  • trunk/src/reglookup-recover.c

    r206 r223  
    573573       */
    574574      vk->data = regfi_buffer_to_data(data);
    575       talloc_steal(vk, vk->data);
     575      talloc_reparent(NULL, vk, vk->data);
    576576    }
    577577  }
     
    612612          goto fail;
    613613        }
    614         talloc_steal(unalloc_keys, key);
     614        talloc_reparent(NULL, unalloc_keys, key);
    615615        j+=key->cell_size-8;
    616616      }
     
    753753          return 20;
    754754        }
    755         talloc_steal(unalloc_sks, sk);
     755        talloc_reparent(NULL, unalloc_sks, sk);
    756756        j+=sk->cell_size-8;
    757757      }
Note: See TracChangeset for help on using the changeset viewer.