@@ -49,9 +49,7 @@ typedef struct http_directive {
4949static void http_destroy_directive (http_directive * self )
5050{
5151 lwc_string_unref (self -> name );
52- if (self -> value != NULL ) {
53- lwc_string_unref (self -> value );
54- }
52+ lwc_string_unref (self -> value );
5553 free (self );
5654}
5755
@@ -90,9 +88,7 @@ static nserror http__parse_directive(const char **input,
9088
9189 directive = malloc (sizeof (* directive ));
9290 if (directive == NULL ) {
93- if (value != NULL ) {
94- lwc_string_unref (value );
95- }
91+ lwc_string_unref (value );
9692 lwc_string_unref (name );
9793 return NSERROR_NOMEM ;
9894 }
@@ -189,9 +185,7 @@ static bool check_duplicates(const http_directive *directives)
189185 result &= (count (directives , name ) == 1 );
190186
191187 lwc_string_unref (name );
192- if (value != NULL ) {
193- lwc_string_unref (value );
194- }
188+ lwc_string_unref (value );
195189 } while (key != NULL );
196190
197191 return result ;
@@ -290,19 +284,15 @@ nserror http_parse_cache_control(const char *header_value,
290284 corestring_lwc_no_cache , & value_str );
291285 if (error == NSERROR_OK ) {
292286 no_cache = true;
293- if (value_str != NULL ) {
294- lwc_string_unref (value_str );
295- }
287+ lwc_string_unref (value_str );
296288 }
297289
298290 /* Find no-store */
299291 error = http_directive_list_find_item (directives ,
300292 corestring_lwc_no_store , & value_str );
301293 if (error == NSERROR_OK ) {
302294 no_store = true;
303- if (value_str != NULL ) {
304- lwc_string_unref (value_str );
305- }
295+ lwc_string_unref (value_str );
306296 }
307297
308298 http_directive_list_destroy (directives );
0 commit comments