File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,7 @@ main(int argc, char **argv)
349349 /* in set mode pkgdb must be locked and flushed on success */
350350 if ((rv = xbps_pkgdb_lock (& xh )) != 0 ) {
351351 xbps_error_printf ("failed to lock pkgdb: %s\n" , strerror (rv ));
352+ xbps_end (& xh );
352353 exit (EXIT_FAILURE );
353354 }
354355 if ((rv = xbps_alternatives_set (& xh , pkg , group )) == 0 )
@@ -361,19 +362,22 @@ main(int argc, char **argv)
361362 struct search_data sd = { 0 };
362363 if ((sd .result = xbps_dictionary_create ()) == NULL ) {
363364 xbps_error_printf ("Failed to create dictionary: %s\n" , strerror (errno ));
365+ xbps_end (& xh );
364366 exit (EXIT_FAILURE );
365367 }
366368 sd .group = group ;
367369 rv = xbps_rpool_foreach (& xh , search_repo_cb , & sd );
368370 if (rv != 0 && rv != ENOTSUP ) {
369371 fprintf (stderr , "Failed to initialize rpool: %s\n" ,
370372 strerror (rv ));
373+ xbps_end (& xh );
371374 exit (EXIT_FAILURE );
372375 }
373376 if (xbps_dictionary_count (sd .result ) > 0 ) {
374377 print_alternatives (& xh , sd .result , group , true);
375378 } else {
376379 xbps_error_printf ("no alternatives groups found\n" );
380+ xbps_end (& xh );
377381 exit (EXIT_FAILURE );
378382 }
379383 } else {
You can’t perform that action at this time.
0 commit comments