* Fix #281 bad free. Also fix a memory leak. With `n->icon = r->new_icon` and later `free(n->icon)` `r->new_icon` is wrongly freed. Fix that with strdup. Also fix an obvious memory leak by the way.
This commit is contained in:
		
							parent
							
								
									dd4deb3b00
								
							
						
					
					
						commit
						1e477395d9
					
				| @ -19,8 +19,11 @@ void rule_apply(rule_t * r, notification * n) | |||||||
|                 n->allow_markup = r->allow_markup; |                 n->allow_markup = r->allow_markup; | ||||||
|         if (r->plain_text != -1) |         if (r->plain_text != -1) | ||||||
|                 n->plain_text = r->plain_text; |                 n->plain_text = r->plain_text; | ||||||
|         if (r->new_icon) |         if (r->new_icon) { | ||||||
|                 n->icon = r->new_icon; |                 if(n->icon) | ||||||
|  |                         g_free(n->icon); | ||||||
|  |                 n->icon = g_strdup(r->new_icon); | ||||||
|  |         } | ||||||
|         if (r->fg) |         if (r->fg) | ||||||
|                 n->color_strings[ColFG] = r->fg; |                 n->color_strings[ColFG] = r->fg; | ||||||
|         if (r->bg) |         if (r->bg) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 John Chen
						John Chen