Permalink
Browse files

Fixes [CLANG]

(raptor_rss_start_element_handler): Remove unused 'attribute_type'
var.

(raptor_rss_insert_identifiers): Initialize 'new_uri' to NULL and
check for failures of it and term construction.
  • Loading branch information...
1 parent 14e05e9 commit 4b0e366fdc906b4da7f6b4f428ea36009a0b6c44 @dajobe dajobe committed May 22, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/raptor_rss.c
View
@@ -556,7 +556,6 @@ raptor_rss_start_element_handler(void *user_data,
const char* attrName = (const char*)attr->local_name;
const unsigned char* attrValue = attr->value;
const raptor_rss_block_field_info *bfi;
- int attribute_type = -1;
int offset = -1;
for(bfi = &raptor_rss_block_fields_info[0];
@@ -566,7 +565,6 @@ raptor_rss_start_element_handler(void *user_data,
continue;
if(bfi->type == block_type && !strcmp(attrName, bfi->attribute)) {
- attribute_type = bfi->attribute_type;
offset = bfi->offset;
break;
}
@@ -1024,15 +1022,21 @@ raptor_rss_insert_identifiers(raptor_parser* rdf_parser)
raptor_rss_field* field;
for(field = item->fields[url_fields[f]]; field; field = field->next) {
- raptor_uri *new_uri;
+ raptor_uri *new_uri = NULL;
if(field->value)
new_uri = raptor_new_uri(rdf_parser->world,
(const unsigned char*)field->value);
else if(field->uri)
new_uri = raptor_uri_copy(field->uri);
+ if(!new_uri)
+ return 1;
+
item->term = raptor_new_term_from_uri(rdf_parser->world, new_uri);
raptor_free_uri(new_uri);
+ if(!item->term)
+ return 1;
+
break;
}
}

0 comments on commit 4b0e366

Please sign in to comment.