Fix resource leak and a null return value dereference
This commit is contained in:
		
				
					committed by
					
						 Tatsuya Kinoshita
						Tatsuya Kinoshita
					
				
			
			
				
	
			
			
			
						parent
						
							dba9fe9753
						
					
				
				
					commit
					3120f496f7
				
			| @@ -81,6 +81,7 @@ print_bookmark_panel(char *bmark, char *url, char *title, char *charset) | |||||||
| 	printf("</select>\n"); | 	printf("</select>\n"); | ||||||
|     } |     } | ||||||
|     printf(bkmark_src2, html_quote(url), html_quote(title)); |     printf(bkmark_src2, html_quote(url), html_quote(title)); | ||||||
|  |     fclose(f); | ||||||
| } | } | ||||||
|  |  | ||||||
| /* create new bookmark */ | /* create new bookmark */ | ||||||
| @@ -168,7 +169,10 @@ insert_bookmark(char *bmark, struct parsed_tagarg *data) | |||||||
| 	/* In this case, a new bookmark is appeneded after the bookmark file */ | 	/* In this case, a new bookmark is appeneded after the bookmark file */ | ||||||
| 	return create_new_bookmark(bmark, section, title, url, "a"); | 	return create_new_bookmark(bmark, section, title, url, "a"); | ||||||
|     } |     } | ||||||
|     f = fopen(bmark, "w"); |     if ((f = fopen(bmark, "w")) == NULL) { | ||||||
|  | 	printf("\nCannot open bookmark %s\n", bmark); | ||||||
|  | 	return FALSE; | ||||||
|  |     } | ||||||
|     while (tl->nitem) { |     while (tl->nitem) { | ||||||
| 	fputs(popText(tl), f); | 	fputs(popText(tl), f); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user