File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -236,18 +236,19 @@ process_one_alternative(const char *altgrname, const char *val)
236236 xbps_dictionary_t d ;
237237 xbps_array_t a ;
238238 const char * altfiles ;
239- bool alloc = false;
239+ bool alloc_dict = false, alloc_array = false;
240240
241241 if ((d = xbps_dictionary_get (pkg_propsd , "alternatives" )) == NULL ) {
242242 d = xbps_dictionary_create ();
243243 if (d == NULL )
244244 die ("xbps_dictionary_create" );
245- alloc = true;
245+ alloc_dict = true;
246246 }
247247 if ((a = xbps_dictionary_get (d , altgrname )) == NULL ) {
248248 a = xbps_array_create ();
249249 if (a == NULL )
250250 die ("xbps_array_create" );
251+ alloc_array = true;
251252 }
252253 altfiles = strchr (val , ':' ) + 1 ;
253254 assert (altfiles );
@@ -256,10 +257,10 @@ process_one_alternative(const char *altgrname, const char *val)
256257 xbps_dictionary_set (d , altgrname , a );
257258 xbps_dictionary_set (pkg_propsd , "alternatives" , d );
258259
259- if (alloc ) {
260+ if (alloc_array )
260261 xbps_object_release (a );
262+ if (alloc_dict )
261263 xbps_object_release (d );
262- }
263264}
264265
265266
You can’t perform that action at this time.
0 commit comments