Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 316975 | Differences between
and this patch

Collapse All | Expand All

(-)library/eclipseConfig.c (-5 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at 
5
 * which accompanies this distribution, and is available at 
Lines 7-12 Link Here
7
 * 
7
 * 
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *	   Martin Oberhuber (Wind River) - [316975] memory leak on failure reading .ini file
10
 *******************************************************************************/
11
 *******************************************************************************/
11
12
12
#include "eclipseOS.h"
13
#include "eclipseOS.h"
Lines 84-93 Link Here
84
	size_t bufferSize = 1024;
85
	size_t bufferSize = 1024;
85
	size_t length;
86
	size_t length;
86
	
87
	
87
	/* allocate buffers */
88
	buffer =  (_TCHAR*)malloc(bufferSize * sizeof(_TCHAR));
89
	argument = (_TCHAR*)malloc(bufferSize * sizeof(_TCHAR));
90
	
91
	/* Open the config file as a text file 
88
	/* Open the config file as a text file 
92
	 * Note that carriage return-linefeed combination \r\n are automatically
89
	 * Note that carriage return-linefeed combination \r\n are automatically
93
	 * translated into single linefeeds on input in the t (translated) mode
90
	 * translated into single linefeeds on input in the t (translated) mode
Lines 96-101 Link Here
96
	file = _tfopen(config_file, _T_ECLIPSE("rt"));	
93
	file = _tfopen(config_file, _T_ECLIPSE("rt"));	
97
	if (file == NULL) return -3;
94
	if (file == NULL) return -3;
98
95
96
	/* allocate buffers */
97
	buffer =  (_TCHAR*)malloc(bufferSize * sizeof(_TCHAR));
98
	argument = (_TCHAR*)malloc(bufferSize * sizeof(_TCHAR));
99
99
	*argv = (_TCHAR **)malloc((1 + maxArgs) * sizeof(_TCHAR*));
100
	*argv = (_TCHAR **)malloc((1 + maxArgs) * sizeof(_TCHAR*));
100
	
101
	
101
	index = 0;
102
	index = 0;

Return to bug 316975