shithub: scc

Download patch

ref: 934e2128978ff00ff47a6bd148e209f73b4b6252
parent: 944846e259100c68c2398bb1ac3b180543f84a5e
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Oct 8 08:43:36 EDT 2021

libmach: Remove duplicated va_end() in pack/unpack

These functions were transformed from normal variable
length argument functions to functions that were accepting
a va_list. In case of error there was still va_end() calls,
that would mean that the va could be ended twice.

--- a/src/libmach/pack.c
+++ b/src/libmach/pack.c
@@ -53,7 +53,6 @@
 			*bp++ = q >> 56;
 			break;
 		default:
-			va_end(va);
 			return -1;
 		}
 	}
@@ -108,7 +107,6 @@
 			*bp++ = q;
 			break;
 		default:
-			va_end(va);
 			return -1;
 		}
 	}
--- a/src/libmach/unpack.c
+++ b/src/libmach/unpack.c
@@ -58,7 +58,6 @@
 			*qp = q;
 			break;
 		default:
-			va_end(va);
 			return -1;
 		}
 	}
@@ -118,7 +117,6 @@
 			*qp = q;
 			break;
 		default:
-			va_end(va);
 			return -1;
 		}
 	}