check return value of alloc functions, from Charles Longeau
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21745 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -87,6 +87,8 @@ static int
|
||||
add_column(struct get_entry_data *data, struct field_name *ff, const char *header)
|
||||
{
|
||||
struct field_info *f = malloc(sizeof(*f));
|
||||
if (f == NULL)
|
||||
return ENOMEM;
|
||||
f->ff = ff;
|
||||
if(header)
|
||||
f->header = strdup(header);
|
||||
|
@@ -123,7 +123,11 @@ generate_password(char **pw, int num_classes, ...)
|
||||
unsigned char rbuf[8]; /* random buffer */
|
||||
int rleft = 0;
|
||||
|
||||
*pw = NULL;
|
||||
|
||||
classes = malloc(num_classes * sizeof(*classes));
|
||||
if(classes == NULL)
|
||||
return;
|
||||
va_start(ap, num_classes);
|
||||
len = 0;
|
||||
for(i = 0; i < num_classes; i++){
|
||||
|
@@ -648,6 +648,10 @@ parse_des_key (const char *key_string, krb5_key_data *key_data,
|
||||
key_data[i].key_data_type[0] = ETYPE_DES_CBC_CRC;
|
||||
key_data[i].key_data_length[0] = 8;
|
||||
key_data[i].key_data_contents[0] = malloc(8);
|
||||
if (key_data[i].key_data_contents[0] == NULL) {
|
||||
*error = "malloc";
|
||||
return ENOMEM;
|
||||
}
|
||||
memcpy (key_data[i].key_data_contents[0], bits, 8);
|
||||
/* salt */
|
||||
key_data[i].key_data_type[1] = KRB5_PW_SALT;
|
||||
|
Reference in New Issue
Block a user