Message ID | 20180828014834.3046-2-honli@redhat.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Hal Rosenstock |
Headers | show |
Series | [1/5] osmt_service.c: fix resource leak in osmt_get_all_services_and_check_names | expand |
On 8/27/2018 9:48 PM, Honggang LI wrote: > From: Honggang Li <honli@redhat.com> > > Signed-off-by: Honggang Li <honli@redhat.com> > --- > osmtest/osmtest.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/osmtest/osmtest.c b/osmtest/osmtest.c > index 4ef78eb0..b7197bf3 100644 > --- a/osmtest/osmtest.c > +++ b/osmtest/osmtest.c > @@ -2736,9 +2736,8 @@ osmtest_create_inventory_file(IN osmtest_t * const p_osmt) > if (status != IB_SUCCESS) > goto Exit; > > - fclose(fh); > - > Exit: > + fclose(fh); This also closes file when not opened. Proposed patch to fix this to follow shortly. -- Hal > OSM_LOG_EXIT(&p_osmt->log); > return (status); > } >
diff --git a/osmtest/osmtest.c b/osmtest/osmtest.c index 4ef78eb0..b7197bf3 100644 --- a/osmtest/osmtest.c +++ b/osmtest/osmtest.c @@ -2736,9 +2736,8 @@ osmtest_create_inventory_file(IN osmtest_t * const p_osmt) if (status != IB_SUCCESS) goto Exit; - fclose(fh); - Exit: + fclose(fh); OSM_LOG_EXIT(&p_osmt->log); return (status); }