History

src/src_*.c : Fix a potential memory leak.

Erik de Castro Lopo committed 17 years ago

Commit 94966fc1 parent beed7b14 files · +10 −15Browse files

Unified · Split

4 files
  1. ChangeLog +4 −0
  2. src/src_linear.c +2 −5
  3. src/src_sinc.c +2 −5
  4. src/src_zoh.c +2 −5
ChangeLog+4−0
@@ -4,6 +4,10 @@ · 3 unmodified lines
44 Fix a couple of very minor warnings uncovered by Erik Hovland using a
55 static analysis tool.
66
7+ * src/src_*.c
8+ Fix a potential memory leak. Thanks to Peter G. Vavaroutsos for point this
9+ out.
10+
711 2008-12-11 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
812
913 * reconfigure.mk autogen.sh
src/src_linear.c+2−5
@@ -174,11 +174,8 @@ linear_set_converter (SRC_PRIVATE *psrc, int src_enum) · 173 unmodified lines
174174 return SRC_ERR_BAD_CONVERTER ;
175175
176176 if (psrc->private_data != NULL)
177− { priv = (LINEAR_DATA*) psrc->private_data ;
178− if (priv->linear_magic_marker != LINEAR_MAGIC_MARKER)
179− { free (psrc->private_data) ;
180− psrc->private_data = NULL ;
181− } ;
177+ { free (psrc->private_data) ;
178+ psrc->private_data = NULL ;
182179 } ;
183180
184181 if (psrc->private_data == NULL)
src/src_sinc.c+2−5
@@ -154,11 +154,8 @@ sinc_set_converter (SRC_PRIVATE *psrc, int src_enum) · 153 unmodified lines
154154 return SRC_ERR_SHIFT_BITS ;
155155
156156 if (psrc->private_data != NULL)
157− { filter = (SINC_FILTER*) psrc->private_data ;
158− if (filter->sinc_magic_marker != SINC_MAGIC_MARKER)
159− { free (psrc->private_data) ;
160− psrc->private_data = NULL ;
161− } ;
157+ { free (psrc->private_data) ;
158+ psrc->private_data = NULL ;
162159 } ;
163160
164161 memset (&temp_filter, 0, sizeof (temp_filter)) ;
src/src_zoh.c+2−5
@@ -165,11 +165,8 @@ zoh_set_converter (SRC_PRIVATE *psrc, int src_enum) · 164 unmodified lines
165165 return SRC_ERR_BAD_CONVERTER ;
166166
167167 if (psrc->private_data != NULL)
168− { priv = (ZOH_DATA*) psrc->private_data ;
169− if (priv->zoh_magic_marker != ZOH_MAGIC_MARKER)
170− { free (psrc->private_data) ;
171− psrc->private_data = NULL ;
172− } ;
168+ { free (psrc->private_data) ;
169+ psrc->private_data = NULL ;
173170 } ;
174171
175172 if (psrc->private_data == NULL)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t