librazor/rpm.c
changeset 246 f92d8239324e
parent 241 c3eb520e2219
child 247 63444a10fb8e
     1.1 --- a/librazor/rpm.c	Mon Jun 16 15:40:30 2008 -0400
     1.2 +++ b/librazor/rpm.c	Thu Jun 19 15:09:48 2008 -0400
     1.3 @@ -322,8 +322,10 @@
     1.4  	unsigned int i, count;
     1.5  	char buffer[256];
     1.6  
     1.7 +	if (rpm->dirs == NULL)
     1.8 +		return;
     1.9 +
    1.10  	/* assert: count is the same for all arrays */
    1.11 -
    1.12  	index = razor_rpm_get_indirect(rpm, RPMTAG_DIRINDEXES, &count);
    1.13  	name = razor_rpm_get_indirect(rpm, RPMTAG_BASENAMES, &count);
    1.14  	for (i = 0; i < count; i++) {
    1.15 @@ -346,6 +348,8 @@
    1.16  	int fd;
    1.17  
    1.18  	rpm = malloc(sizeof *rpm);
    1.19 +	if (rpm == NULL)
    1.20 +		return NULL;
    1.21  	memset(rpm, 0, sizeof *rpm);
    1.22  
    1.23  	fd = open(filename, O_RDONLY);