(1823) record: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									162cb6e18d
								
							
						
					
					
						commit
						bd9df5b62c
					
				|  | @ -2712,7 +2712,8 @@ RecordAClientStateChange(CallbackListPtr *pcbl, void *nulldata, | ||||||
|         /* RecordDisableContext modifies contents of ppAllContexts. */ |         /* RecordDisableContext modifies contents of ppAllContexts. */ | ||||||
|         if (!(numContextsCopy = numContexts)) |         if (!(numContextsCopy = numContexts)) | ||||||
|             break; |             break; | ||||||
|         ppAllContextsCopy = calloc(numContextsCopy, sizeof(RecordContextPtr)); |         if (!(ppAllContextsCopy = calloc(numContextsCopy, sizeof(RecordContextPtr)))) | ||||||
|  |             return; | ||||||
|         assert(ppAllContextsCopy); |         assert(ppAllContextsCopy); | ||||||
|         memcpy(ppAllContextsCopy, ppAllContexts, |         memcpy(ppAllContextsCopy, ppAllContexts, | ||||||
|                numContextsCopy * sizeof(RecordContextPtr)); |                numContextsCopy * sizeof(RecordContextPtr)); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue