add some more error strings

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10338 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2001-07-13 06:30:42 +00:00
parent 398331a46c
commit c7562eda65
7 changed files with 152 additions and 69 deletions

View File

@@ -50,6 +50,7 @@ hdb_principal2key(krb5_context context, krb5_principal p, krb5_data *key)
len = length_Principal(&new);
buf = malloc(len);
if(buf == NULL){
krb5_set_error_string(context, "malloc: out of memory");
ret = ENOMEM;
goto out;
}
@@ -80,8 +81,10 @@ hdb_entry2value(krb5_context context, hdb_entry *ent, krb5_data *value)
len = length_hdb_entry(ent);
buf = malloc(len);
if(buf == NULL)
if(buf == NULL) {
krb5_set_error_string(context, "malloc: out of memory");
return ENOMEM;
}
ret = encode_hdb_entry(buf + len - 1, len, ent, &len);
if(ret){
free(buf);
@@ -128,8 +131,10 @@ _hdb_store(krb5_context context, HDB *db, unsigned flags, hdb_entry *entry)
if(entry->generation == NULL) {
struct timeval t;
entry->generation = malloc(sizeof(*entry->generation));
if(entry->generation == NULL)
if(entry->generation == NULL) {
krb5_set_error_string(context, "malloc: out of memory");
return ENOMEM;
}
gettimeofday(&t, NULL);
entry->generation->time = t.tv_sec;
entry->generation->usec = t.tv_usec;