Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 197614 Details for
Bug 277478
sci-libs/rsl-1.40.ebulid (new ebuild)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix some memory leaks.
rsl-valgrind.patch (text/plain), 4.18 KB, created by
Andy Spencer
on 2009-07-12 09:58:50 UTC
(
hide
)
Description:
Patch to fix some memory leaks.
Filename:
MIME Type:
Creator:
Andy Spencer
Created:
2009-07-12 09:58:50 UTC
Size:
4.18 KB
patch
obsolete
>diff -w -ru rsl-v1.40/wsr88d_m31.c rsl-v1.40.test/wsr88d_m31.c >--- rsl-v1.40/wsr88d_m31.c 2008-10-08 23:43:03.000000000 +0000 >+++ rsl-v1.40.test/wsr88d_m31.c 2009-05-14 10:06:23.000000000 +0000 >@@ -515,6 +515,7 @@ > m1_ray.vol_cpat = vcp_data.vcp; > m1_ray.elev_num = ray_hdr.elev_num; > m1_ray.unam_rng = wsr88d_ray.unamb_rng; >+ m1_ray.nyq_vel = wsr88d_ray.nyq_vel; // TODO: is this correct? > if (ray_hdr.azm_res != 1) > ray->h.beam_width = 1.0; > else ray->h.beam_width = 0.5; >@@ -603,6 +604,8 @@ > radar->v[vol_index]->sweep[isweep]->ray[iray] = ray; > radar->v[vol_index]->sweep[isweep]->h.nrays = iray+1; > } >+ free(wsr88d_ray.ref->data); >+ free(wsr88d_ray.ref); > } > > if (wsr88d_ray.ray_hdr.dbptr_vel > 0) { >@@ -628,6 +631,8 @@ > wsr88d_load_ray_hdr(wsr88d_ray, ray); > radar->v[vol_index]->sweep[isweep]->ray[iray] = ray; > radar->v[vol_index]->sweep[isweep]->h.nrays = iray+1; >+ free(wsr88d_ray.vel->data); >+ free(wsr88d_ray.vel); > } > > if (wsr88d_ray.ray_hdr.dbptr_sw > 0) { >@@ -653,6 +658,8 @@ > wsr88d_load_ray_hdr(wsr88d_ray, ray); > radar->v[vol_index]->sweep[isweep]->ray[iray] = ray; > radar->v[vol_index]->sweep[isweep]->h.nrays = iray+1; >+ free(wsr88d_ray.sw->data); >+ free(wsr88d_ray.sw); > } > > } >@@ -706,15 +713,27 @@ > * at the WSR-88D Radar Operations Center web site. > */ > >- n = fread(&msghdr, sizeof(Wsr88d_msg_hdr), 1, wf->fptr); >- >- /* printf("msgtype = %d\n", msghdr.msg_type); */ >- msg_hdr_size = sizeof(Wsr88d_msg_hdr) - sizeof(msghdr.rpg); > > > radar = RSL_new_radar(MAX_RADAR_VOLUMES); > > while (! end_of_vos) { >+ /* Read current header */ >+ n = fread(&msghdr, sizeof(Wsr88d_msg_hdr), 1, wf->fptr); >+ if (n < 1) { >+ fprintf(stderr,"Warning: load_wsr88d_m31_into_radar: "); >+ if (feof(wf->fptr) != 0) fprintf(stderr, >+ "Unexpected end of file.\n"); >+ else fprintf(stderr,"Failed reading msghdr.\n"); >+ fprintf(stderr,"Current sweep number: %d\n" >+ "Last ray read: %d\n", isweep+1, iray); >+ wsr88d_load_sweep_header(radar, isweep, wsr88d_ray); >+ return radar; >+ } >+ >+ /* printf("msgtype = %d\n", msghdr.msg_type); */ >+ msg_hdr_size = sizeof(Wsr88d_msg_hdr) - sizeof(msghdr.rpg); >+ > if (msghdr.msg_type == 31) { > if (little_endian()) wsr88d_swap_m31_hdr(&msghdr); > >@@ -729,6 +748,18 @@ > /* Load this ray into radar structure ray. */ > wsr88d_load_ray_into_radar(wsr88d_ray, isweep, iray, radar); > iray++; >+ >+ /* Check for end of sweep */ >+ if (wsr88d_ray.ray_hdr.radial_status == END_OF_ELEV) { >+ wsr88d_load_sweep_header(radar, isweep, wsr88d_ray); >+ isweep++; >+ iray = 0; >+ } >+ >+ if (wsr88d_ray.ray_hdr.radial_status == END_VOS) { >+ //wsr88d_load_sweep_header(radar, isweep, wsr88d_ray); >+ end_of_vos = 1; >+ } > } > else { /* msg_type not 31 */ > n = fread(&non31_seg_remainder, sizeof(non31_seg_remainder), 1, >@@ -748,33 +779,11 @@ > radar->h.vcp = vcp_data.vcp; > /* printf("VCP = %d\n", vcp_data.vcp); */ > } >+ /* TODO: check for end of sweep/volume */ > } > >- /* Check for end of sweep */ >- if (wsr88d_ray.ray_hdr.radial_status == END_OF_ELEV) { >- wsr88d_load_sweep_header(radar, isweep, wsr88d_ray); >- isweep++; >- iray = 0; >- } >- >- if (wsr88d_ray.ray_hdr.radial_status != END_VOS) { >- n = fread(&msghdr, sizeof(Wsr88d_msg_hdr), 1, wf->fptr); >- if (n < 1) { >- fprintf(stderr,"Warning: load_wsr88d_m31_into_radar: "); >- if (feof(wf->fptr) != 0) fprintf(stderr, >- "Unexpected end of file.\n"); >- else fprintf(stderr,"Failed reading msghdr.\n"); >- fprintf(stderr,"Current sweep number: %d\n" >- "Last ray read: %d\n", isweep+1, iray); >- wsr88d_load_sweep_header(radar, isweep, wsr88d_ray); >- return radar; >- } >- } >- else { >+ if (feof(wf->fptr) != 0) > end_of_vos = 1; >- wsr88d_load_sweep_header(radar, isweep, wsr88d_ray); >- } >- if (feof(wf->fptr) != 0) end_of_vos = 1; > } > > return radar; >diff -w -ru rsl-v1.40/wsr88d_to_radar.c rsl-v1.40.test/wsr88d_to_radar.c >--- rsl-v1.40/wsr88d_to_radar.c 2008-07-30 22:41:20.000000000 +0000 >+++ rsl-v1.40.test/wsr88d_to_radar.c 2009-05-14 10:07:09.000000000 +0000 >@@ -429,5 +429,6 @@ > radar->h.lpulse = sitep->lpulse; > > radar = RSL_prune_radar(radar); >+ free(sitep); > return radar; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 277478
:
197610
|
197611
|
197613
| 197614 |
197616
|
197622
|
197623