Merge pull request #203 from kcwu/fix-str-stream-leak
fix StrStream memory leak
This commit is contained in:
		
							
								
								
									
										16
									
								
								istream.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								istream.c
									
									
									
									
									
								
							| @@ -185,12 +185,16 @@ int | |||||||
| ISclose(InputStream stream) | ISclose(InputStream stream) | ||||||
| { | { | ||||||
|     MySignalHandler(*prevtrap) (); |     MySignalHandler(*prevtrap) (); | ||||||
|     if (stream == NULL || stream->base.close == NULL || |     if (stream == NULL) | ||||||
| 	stream->base.type & IST_UNCLOSE) |         return -1; | ||||||
| 	return -1; |     if (stream->base.close != NULL) { | ||||||
|     prevtrap = mySignal(SIGINT, SIG_IGN); |         if (stream->base.type & IST_UNCLOSE) { | ||||||
|     stream->base.close (stream->base.handle); |             return -1; | ||||||
|     mySignal(SIGINT, prevtrap); |         } | ||||||
|  |         prevtrap = mySignal(SIGINT, SIG_IGN); | ||||||
|  |         stream->base.close (stream->base.handle); | ||||||
|  |         mySignal(SIGINT, prevtrap); | ||||||
|  |     } | ||||||
|     xfree(stream->base.stream.buf); |     xfree(stream->base.stream.buf); | ||||||
|     xfree(stream); |     xfree(stream); | ||||||
|     return 0; |     return 0; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user