Description: Update bindings for libsvm3.
 Upstream makes use of bundled libsvm2 which has been removed on a
 separate patch.  This patch updates the bindings for libsvm3 which
 is packaged in Debian.
 .
 The libsvm README file states the following:
 - Function: void svm_free_and_destroy_model(struct svm_model **model_ptr_ptr);
 .
    This function frees the memory used by a model and destroys the model
    structure. It is equivalent to svm_destroy_model, which
    is deprecated after version 3.0.
Origin: vendor
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=79106
Author: Mathieu Bridon <bochecha@fedoraproject.org>
Last-Update: Tue, 21 Aug 2012 12:14:18 +0800

--- a/bindings.cpp
+++ b/bindings.cpp
@@ -166,7 +166,7 @@
 
   // Free any old model we have.
   if(model != NULL) {
-    svm_destroy_model(model);
+    svm_free_and_destroy_model(&model);
     model = NULL;
   }
 
@@ -282,7 +282,7 @@
   }
 
   if(model != NULL) {
-    svm_destroy_model(model);
+    svm_free_and_destroy_model(&model);
     model = NULL;
   }
 
@@ -357,7 +357,7 @@
 	sumyy += y*y;
 	sumvy += v*y;
       }
-      svm_destroy_model(submodel);
+      svm_free_and_destroy_model(&submodel);
       // cout << "Mean squared error = %g\n", error/(end-begin));
       total_error += error;			
     } else {
@@ -368,7 +368,7 @@
 	double v = svm_predict(submodel,prob->x[j]);
 	if(v == prob->y[j]) ++correct;
       }
-      svm_destroy_model(submodel);
+      svm_free_and_destroy_model(&submodel);
       //cout << "Accuracy = " << 100.0*correct/(end-begin) << " (" <<
       //correct << "/" << (end-begin) << endl;
       total_correct += correct;
@@ -423,6 +423,6 @@
 
 SVM::~SVM() {
 	if(x_space!=NULL) { free_x_space(); }
-  if(model != NULL) { svm_destroy_model(model); model=NULL; }
+  if(model != NULL) { svm_free_and_destroy_model(&model); model=NULL; }
   if(prob != NULL) { free(prob); prob=NULL; }
 }
