Commit c39904ba authored by Shane Snyder's avatar Shane Snyder
Browse files

fix a couple of memory leaks

parent 89a97a0f
...@@ -355,9 +355,11 @@ int darshan_log_putjob(darshan_fd fd, struct darshan_job *job) ...@@ -355,9 +355,11 @@ int darshan_log_putjob(darshan_fd fd, struct darshan_job *job)
if(ret != comp_buf_sz) if(ret != comp_buf_sz)
{ {
fprintf(stderr, "Error: failed to write darshan log file job data.\n"); fprintf(stderr, "Error: failed to write darshan log file job data.\n");
free(comp_buf);
return(-1); return(-1);
} }
free(comp_buf);
return(0); return(0);
} }
...@@ -876,9 +878,11 @@ int darshan_log_putmod(darshan_fd fd, darshan_module_id mod_id, ...@@ -876,9 +878,11 @@ int darshan_log_putmod(darshan_fd fd, darshan_module_id mod_id,
fprintf(stderr, fprintf(stderr,
"Error: failed to write module %s data to darshan log file.\n", "Error: failed to write module %s data to darshan log file.\n",
darshan_module_names[mod_id]); darshan_module_names[mod_id]);
free(comp_buf);
return(-1); return(-1);
} }
free(comp_buf);
return(0); return(0);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment